This is the mail archive of the
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 ?
I am working with a cross toolchain for arm-elf based on gcc 3.4.0 and
Since I want to remove dead code in the produced binary I added
-ffunction-sections on the compile line and --gc-sections on the
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,