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: ppc64le: expected localentry:0 `pthread_condattr_destroy'


On Thu, Jul 27, 2017 at 01:40:11PM -0400, Carlos O'Donell wrote:
> On 07/27/2017 12:04 AM, Alan Modra wrote:
> >>>> On 07/25/2017 09:11 PM, Josh Stone wrote:
> >>>>> ./bin/rustc: error while loading shared libraries:
> >>>>> ./lib/libstd-c3a1748e15265da7.so: expected localentry:0
> >>>>> `pthread_condattr_destroy'
> > 
> > You will get this error if the link-time version of a function symbol
> > is seen as localentry:0 (ie. not needing a global entry point due to
> > not needing a valid r2 toc pointer), but the run-time version does.
> > 
> > The most likely thing is that your library was linked against a stub
> > version of pthread_condattr_destroy.  Making the stub weak will
> > disable the generation of the optimized localentry:0 plt call code.
> > So will linking with -Wl,--no-plt-localentry
>  
> 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.

-- 
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]