This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/13177: garbage collector retains zombie references to external libraries
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Mon, 17 Oct 2011 10:21:37 -0700
- Subject: Re: PATCH: PR ld/13177: garbage collector retains zombie references to external libraries
- References: <20110914191438.GA4795@intel.com> <20110915002501.GM10321@bubble.grove.modra.org> <CAMe9rOo0ADerLbtb6=J4KWS8LvtGhWnKy66vEQfcnsRZ08x+gw@mail.gmail.com> <20110916005216.GP10321@bubble.grove.modra.org> <20111017072847.GK9539@bubble.grove.modra.org>
On Mon, Oct 17, 2011 at 12:28 AM, Alan Modra <amodra@gmail.com> wrote:
> HJ,
> ?Your patch for PR13177 causes
> hppa-linux ?+FAIL: --gc-sections with __start_
> mips64-linux ?+FAIL: --gc-sections with __start_
> mipsel-linux-gnu ?+FAIL: --gc-sections with __start_
> mipsisa32el-linux ?+FAIL: --gc-sections with __start_
> mips-linux ?+FAIL: --gc-sections with __start_
> powerpc64-linux ?+FAIL: --gc-sections with __start_
>
> The failures show up because __start__foo is undefined when
> lang_gc_sections runs (the symbol is defined later in
> lang_place_orphans). ?This exposes an error in the way you treat
> undefined symbols. ?Not all ABIs require an undefined symbol reference
> to generate a PLT entry. ?You only need one when there is a function
> call, or when the address of a function is taken and the ABI defines
> the address to be the PLT entry in the executable
> (ptr_equality_needed case). ?So it is quite reasonable for
> __start__foo to have a plt.refcount of zero in elf_gc_sweep_symbol.
>
> I'm testing the following.
>
> ? ? ? ?PR ld/13177
> ? ? ? ?* elflink.c (_bfd_elf_gc_mark_rsec): Set symbol "mark".
> ? ? ? ?(elf_gc_sweep_symbol): Don't test plt/got refcounts, instead test
> ? ? ? ?"mark". ?Hide undefweak too.
> ? ? ? ?(elf_link_output_extsym): Correct test for warning when forced local
> ? ? ? ?executable syms are referenced from shared libraries.
>
Should we make elf_gc_sweep_symbol target dependent to take ABI
differences into account?
--
H.J.