This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use IE model for static variables in glibc
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 10 Jul 2015 10:48:23 +0530
- Subject: Re: [PATCH] Use IE model for static variables in glibc
- Authentication-results: sourceware.org; auth=none
- References: <20150709180544 dot GA8522 at spoyarek dot pnq dot redhat dot com> <20150709204033 dot 262B02C39DC at topped-with-meat dot com>
On Thu, Jul 09, 2015 at 01:40:33PM -0700, Roland McGrath wrote:
> The tests should have comments explaining what they are testing.
Ugh, I actually looked at the test now - I had just lifted it from
Alex's patch. I'll fix it up with the comment, copyright notice, etc.
> If it's important that all TLS accesses in libc code be IE, then there
> should be a static test for that. Perhaps it could grep readelf -r output
> for the TLS dynamic reloc types. Or perhaps there is something we could do
> to make references to __tls_get_addr when linking libc.so be a hard failure.
>
> If the intent is to catch all TLS access in libc code, then why are you
> touching the source instead of just compiling with -ftls-model=initial-exec
> across the board? If we do that, then it's probably fine not to have the
> static test.
I'll need to ensure that test cases are not built with
-ftls-model=initial-exec and also specific cases like memusage.
Basically, it is more work and is probably not something I can finish
in time for 2.22, given that I have other stuff to finish in the near
term. I'll add the readelf test case now to ensure that all libc.so
and libpthread.so code is IE. I've not reviewed the other modules and
I suspect that some of them should not have it either. Do you think
it would be OK if I do this in 2.23?
I also have to look at the impact on ARM since it uses
-ftls-model=gnu2 to get tls descriptors. I reckon it would actually
be an improvement, but I'd like to make sure that it is. There's also
a good case IMO to somehow compute static TLS usage within libc.so and
libpthread.so and add that to the surplus. That way the surplus would
be reserved specifically for user DSOs that absolutely want to use IE
and libc will never encroach that. Again a good project for 2.23.
Siddhesh