This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch to fix a bug with version scripts and gc-sections in the GOLD linker.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]