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]

tst-tlsopt-powerpc fail

On Fri, Jul 28, 2017 at 09:15:29AM +0930, Alan Modra wrote:
> On Thu, Jul 27, 2017 at 01:40:11PM -0400, Carlos O'Donell wrote:
> > The new binutils 2.29 also appears to break glibc's tst-tlsopt-ppc test.
> > 
> > Which fails with:
> > tls_index not optimized, binutils too old?
> > 
> > I don't know if this is a test invariant being broken by the new binutils
> > in which case the test needs updating.
> > 
> > Tulio, Are you seeing this?
> That is a different issue, exposed by binutils commit 676ee2b5f
> 	* elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
> 	__tls_index GOT entries when using __tls_get_addr_opt stub.
> 	* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
> Before that, optimized __tls_index entries were generated by ld,
> wrongly so for a shared library.  Now, the __tls_index entry needs to
> be set up by a call to __tls_get_addr_opt.  I think it is exposing a
> problem with CHECK_STATIC_TLS / TRY_STATIC_TLS in glibc but I have not
> properly debugged it yet.

OK, so now I have looked at it properly.  Ignore my comment about
__tls_get_addr_opt needing to set up the __tls_index entry.  That was
just plain wrong.  I'd forgotten how things are supposed to work.

The __tls_index entry is set up by processing DTPMOD64 and
DTPREL64 dynamic relocs, but in the case of tst-tslopt-powerpc we
don't have any such relocs..  It's really just a testsuite issue.
tst-tlsopt-powerpc.c was bogus from the start, and probably only
worked because ld emitted dynamic relocs unnecessarily.

Since tst-tlsopt-powerpc is supposed to test glibc dynamic relocation
processing, the body of the test ought to be put in a shared library
(*).  I cobbled together such a test, and TRY_STATIC_TLS works fine.
So, not a powerpc64 glibc bug.

*) Or at the very least, the thread variable put in a shared library,
but the whole thing shared is probably better.

Alan Modra
Australia Development Lab, IBM

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