This is the mail archive of the 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] PR ld/21233: Avoid sweeping forced-undefined symbols in section GC

On Wed, 5 Apr 2017, Alan Modra wrote:

> >  I suspect some targets might not have a psABI as simple as that however 
> > and might require (or just want) a copy relocation even where the only 
> > reference is a static pointer from data, and these might indeed rely on 
> > the relative order `elf_gc_sweep' and `_bfd_elf_link_check_relocs' are 
> > called in.
> The test has a reference from .data to "bar" that sets non_got_ref and
> pointer_equality_needed, increments plt.refcount in case "bar" turns
> out to be a function, and records the need for a possible dynamic
> reloc in dyn_relocs, in check_relocs on powerpc64le.  .data is then
> garbage collected, which removes the dyn_reloc entry and decrements
> plt.refcount too (*) in gc_sweep_hook but can't remove flags like
> non_got_ref.  ppc64_elf_adjust_dynamic_symbol does clear non_got_ref
> later, and doesn't make a nonsense entry in .dynbss with copy relocs.
> *) plt.refcount isn't decremented in this case on ppc64le.  Bug!  So
>    it was worth looking at the testcase.  :)

 Fair enough.  I'm glad you've found my test case useful. :)

> >  Committed unchanged then.  Any issue with backporting it to 2.28, as per 
> > the situation with the problem report?
> I think backporting should omit the testcase, to avoid unduly worrying
> users.

 I thought so as well as I was asking my question, but didn't want to 
suggest the answer. ;)  I've backported the fix itself only then to 2.28, 
and closed the PR now.

 Thanks for your input.


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