This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld: --gc-sections incompatible with --emit-relocs ?
- From: "David Lamy-Charrier" <david dot lamy at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 11 Oct 2006 16:45:03 +0200
- Subject: 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