MIPS -gc-sections broken?
Nick Clifton
nickc@redhat.com
Tue Jun 2 16:21:00 GMT 2009
Hi Hiroki,
> $ mips-unknown-linux-dev-gcc -ffunction-sections -fdata-sections -Wl,-gc-sections -o test foo.c main.c
> $ mips-unknown-linux-dev-readelf -s test | grep gbl_common
> 4: 00000000 7200 OBJECT GLOBAL DEFAULT ABS gbl_common
>
> and does not belong to any section... gbl_common symbol should be
> removed, or at least have its entry in .bss section.
> Any hints, comments are appreciated!
I tried this and it worked for me. As in the executable did not contain
any reference to the gbl_common symbol. Possible differences between my
build and yours are:
* I was using the current mainline binutils sources.
* I was using the current mainline gcc sources.
* I configured the toolchain for a mipsisa32-elf target.
So. My suggestion would be to first try using the latest binutils
sources and if that does not fix anything, check the output from gcc to
make sure that func_not_used really is being placed into its own section.
Cheers
Nick
More information about the Binutils
mailing list