This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Optimised output from ld
- From: Dan Hovang <dan at wespot dot com>
- To: binutils at sources dot redhat dot com
- Date: Fri, 09 May 2003 10:55:29 +0200
- Subject: 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