This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Optimised output from ld


Hi,

I want ld to produce a minimum size relocatable ELF for use in an
embedded system with our own run-time ELF loader. So after compiling
all source (C and C++) files with -ffunction-sections and
-fdata-sections I tried:

ld -r *.o -o myapp.o

After disassembly I noticed that alot of relative jumps within the
same section were not resolved which increased the size of the ELF
with reloc info. Is there some way to tell ld to try and resolv
as many relocs as possible?

I would also like to use --gc-sections still producing relocatable
output. Like ld -r -e main --gc-sections *.o myapp.o, discarding
sections not referenced to (direct/indirect) by main. ld tells me
that I cannot do that, but I don't understand why.

Any help would be appreciated! I'm using arm-elf-binutils.

Thanks,
 Dan

--
Dan Hovang   dan at wespot dot com    +46 733 451 427
WeSpot AB    Scheleevägen 19c  223 70 Lund, Sweden


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]