Quick --gc-sections question

Octoploid cryptooctoploid@gmail.com
Tue Nov 8 07:36:00 GMT 2011
On Tue, Nov 8, 2011 at 6:35 AM, Alan Modra <amodra@gmail.com> wrote:
> On Mon, Nov 07, 2011 at 09:50:26PM +0100, Octoploid wrote:
>> On Mon, Nov 7, 2011 at 9:13 PM, Ian Lance Taylor <iant@google.com> wrote:
>> > I'll note that this was recently fixed in gold.  If --export-dynamic is
>> > passed to the linker, I think we should not garbage collect globally
>> > visible functions.
>
> Try this.
> -         || (!info->executable
> +         || ((!info->executable || info->export_dynamic)

Great and easy enough ;-)

 % ld -v
GNU ld (GNU Binutils) 2.22.51.20111108
 % gcc -ffunction-sections -rdynamic
-Wl,--gc-sections,--print-gc-sections check.c 2>&1 | grep .text.fun
 % nm -D a.out|grep fun
0000000000400622 T fun

-- 
controlled by gamma light



More information about the Binutils mailing list