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: Linker garbage collection should not collect unreferenced symbols if they are externally visible and export-dynamic is on


Thanks, made those changes and committed the patch.

-Sri.

On Mon, Oct 31, 2011 at 2:24 PM, Ian Lance Taylor <iant@google.com> wrote:
> Sriraman Tallam <tmsriram@google.com> writes:
>
>> ? ? ? * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
>> ? ? ? gc_mark_symbol.
>> ? ? ? * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
>> ? ? ? gc_mark_symbol.
>> ? ? ? Change to just keep the section associated with symbol.
>> ? ? ? (Symbol_table::add_from_relobj): Mark symbols as not garbage when
>> ? ? ? they are externally visible and --export-dynamic is turned on.
>> ? ? ? (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
>
>
>> ?void
>> -Symbol_table::gc_mark_symbol_for_shlib(Symbol* sym)
>> +Symbol_table::gc_mark_symbol(Symbol* sym)
>> ?{
>> - ?if (!sym->is_from_dynobj()
>> - ? ? ?&& sym->is_externally_visible())
>> + ?//Add the object and section to the work list.
>
> Space after "//".
>
>
>> @@ -626,16 +622,7 @@ Symbol_table::gc_mark_dyn_syms(Symbol* s
>> ?{
>> ? ?if (sym->in_dyn() && sym->source() == Symbol::FROM_OBJECT
>> ? ? ? ?&& !sym->object()->is_dynamic())
>> - ? ?{
>> - ? ? ?Relobj* obj = static_cast<Relobj*>(sym->object());
>> - ? ? ?bool is_ordinary;
>> - ? ? ?unsigned int shndx = sym->shndx(&is_ordinary);
>> - ? ? ?if (is_ordinary && shndx != elfcpp::SHN_UNDEF)
>> - ? ? ? ?{
>> - ? ? ? ? ?gold_assert(this->gc_ != NULL);
>> - ? ? ? ? ?this->gc_->worklist().push(Section_id(obj, shndx));
>> - ? ? ? ?}
>> - ? ?}
>> + ? ?gc_mark_symbol(sym);
>> ?}
>
> Write this->gc_mark_symbol(sym);
>
>
> This is OK with those changes.
>
> Thanks.
>
> Ian
>


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