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: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Date: Tue, 18 Oct 2011 00:19:59 +1030
- 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 05:58:47PM +1030, Alan Modra wrote:
> 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.
I found this resulted in a couple of errors in the gcc testsuite.
+FAIL: 23_containers/vector/allocator/copy.cc (test for excess errors)
+FAIL: 23_containers/vector/allocator/minimal.cc (test for excess errors)
Both of these are link errors
copy.o:(.eh_frame+0x123): unresolvable R_PPC_ADDR32 relocation against
symbol `__gxx_personality_v0@@CXXABI_1.3'
My new linker gc-sections code has correctly decided that
__gxx_personality_v0 is not needed, the eh_frame editing code also
correctly discards the CIE referring to this symbol. The trouble is
that the entire .eh_frame section is relocated, not just those parts
copied to output. So we get a silly relocation error for a CIE that
isn't used.
Curable by suppressing the error as follows, but of course this needs
duplicating for all ELF backends. :-(
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.302
diff -u -p -r1.302 elf32-ppc.c
--- bfd/elf32-ppc.c 14 Aug 2011 09:17:17 -0000 1.302
+++ bfd/elf32-ppc.c 17 Oct 2011 13:44:13 -0000
@@ -8150,7 +8150,9 @@ ppc_elf_relocate_section (bfd *output_bf
if (unresolved_reloc
&& !((input_section->flags & SEC_DEBUGGING) != 0
- && h->def_dynamic))
+ && h->def_dynamic)
+ && _bfd_elf_section_offset (output_bfd, info, input_section,
+ rel->r_offset) != (bfd_vma) -1)
{
info->callbacks->einfo
(_("%P: %H: unresolvable %s relocation against symbol `%s'\n"),
--
Alan Modra
Australia Development Lab, IBM