ld conflict between -r and --gc-sections
Joel Sherrill
joel.sherrill@oarcorp.com
Fri Mar 11 00:35:00 GMT 2016
On 3/10/2016 6:29 PM, Alan Modra wrote:
> On Thu, Mar 10, 2016 at 05:13:57PM -0600, Joel Sherrill wrote:
>> i386-rtems4.12-gcc --pipe -B../../../../../.././lib/ -B../../../../../.././pc386/lib/ -specs bsp_specs -qrtems -mtune=i386 -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs -qnolinkcmds -nostdlib -r -Wl,--gc-sections -Wl,-Ttext,0x00100000 -o ne2000.rel ne2000_rel-ne2000.o
>> /data/home/joel/rtems-4.11-work/tools/4.12/bin/../lib/gcc/i386-rtems4.12/6.0.0/../../../../i386-rtems4.12/bin/ld: gc-sections requires either an entry or an undefined symbol
>> collect2: error: ld returned 1 exit status
>>
>> Is this an x86 specific issue? Or is there something I
>> need to tweak in our linker script?
>>
>> Any other ideas?
>
> User error. -r and --gc-sections requires that you specify -e and/or
> -u to specify the root symbol(s) you wish to keep.
>
Thanks. That makes sense. This will be tedious to fix but not hard.
I wonder why this hadn't broken in the other 150+ BSPs. Weird.
I suspect I need to check my build configure arguments
and build everything again. This might break more BSPs. :(
--joel
More information about the Binutils
mailing list