This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH][BZ #16214] Fix TLS access on S390 with -march=z10
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org, carlos at redhat dot com
- Date: Thu, 28 Nov 2013 17:53:10 +0530
- Subject: Re: [PATCH][BZ #16214] Fix TLS access on S390 with -march=z10
- Authentication-results: sourceware.org; auth=none
- References: <20131125055009 dot GK19834 at spoyarek dot pnq dot redhat dot com> <20131127210146 dot GA22879 at bart> <20131128043516 dot GD20495 at spoyarek dot pnq dot redhat dot com> <52971AFE dot 2070502 at linux dot vnet dot ibm dot com>
On Thu, Nov 28, 2013 at 11:29:18AM +0100, Andreas Krebbel wrote:
> > I think the canonical way to avoid PLT dereference within ld.so or
> > libc.so is to have the function with the exported name and have an
> > rtld_hidden_def? So in this case the function should be
> > ___tls_get_addr with a rtld_hidden_def() directive.
> The sequence above was the only way I found to export a tls_get_addr version privately without
> exporting the original version but I'm eager to hear about better ways. I've failed with the following:
> - Put a Versions script somewhere in the path which replaces GLIBC_2.3 on __tls_get_addr with
> GLIBC_PRIVATE. No matter where I put it it appears after the original version definition and is
> ignored that way.
> - Adding a new symbol for __tls_get_addr and putting the GLIBC_PRIVATE version on it. The new
> symbol can only be exported when removing the hidden attribute from the original function but this
> led to the original function to be exported as __tls_get_addr@@GLIBC_2.3 what I'm trying to prevent.
How about just something like:
strong_alias (__tls_get_addr, __tls_get_addr_internal);
and then adding __tls_get_addr_internal as GLIBC_PRIVATE in Versions?
I believe that should keep __tls_get_addr private and export
__tls_get_addr_internal@@GLIBC_PRIVATE. I don't have a test box yet
to verify my claim, so this is again a suggestion based on just
reading the code.