This is the mail archive of the binutils@sourceware.org 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]

ld: --gc-sections incompatible with --emit-relocs ?


Hello,

I am working with a cross toolchain for arm-elf based on gcc 3.4.0 and
binutils 2.15.90.
Since I want to remove dead code in the produced binary I added
-ffunction-sections on the compile line and --gc-sections on the
linker line.
But I get a warning "Warning: gc-sections option ignored" and the
unused functions are not removed in the binary.

After some tests, it appears that I also specify --emit-relocs on the
linker line, and removing this --emit-relocs causes --gc-sections to
work as expected.

I also tested with GCC 4.1.0 and binutils 2.17 and it doesn't work too.

Is any of you aware of such a limitation ? I did not find any
reference in the manual.
I would appreciate any hints on how to try to remove/workaround this limitation.


Thanks in advance, David


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