This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Patch to fix a bug with version scripts and gc-sections in the GOLD linker.
- From: Ian Lance Taylor <iant at google dot com>
- To: Sriraman Tallam <tmsriram at google dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Fri, 22 Jul 2011 15:09:18 -0700
- Subject: Re: Patch to fix a bug with version scripts and gc-sections in the GOLD linker.
- References: <CAAs8HmyOASwprsov34Vw515vyS5+HFDf=FuQXL789wFN+7ZiGA@mail.gmail.com>
Sriraman Tallam <tmsriram@google.com> writes:
> Function bar is not garbage collected even though it is local.
>
> This simple patch fixes it.
>
> * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Check if symbol
> is not forced local before marking it as referenced.
> (Symbol_table::add_from_relobj): Mark symbol as referenced only after
> checking if they cannot be forced local.
I would like to suggest that you instead change
Symbol::is_externally_visible to return false if this->is_forced_local()
is true. I think that will fix your problem, and I don't think think
that will break anything--but, then, I haven't tried it.
If that patch works, it is preapproved.
Thanks.
Ian