This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] fix static TLS consumption by TLS descriptors
- From: Will Newton <will dot newton at linaro dot org>
- To: Kyle McMartin <kmcmarti at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 4 Jun 2014 09:22:42 +0100
- Subject: Re: [PATCH] fix static TLS consumption by TLS descriptors
- Authentication-results: sourceware.org; auth=none
- References: <20140514203250 dot GK26038 at redacted dot bos dot redhat dot com> <20140514205448 dot GL26038 at redacted dot bos dot redhat dot com> <CANu=Dmjp_bLObfPxwHNV4vQySD4k2dt4TJCo=Y6ySg2WbKmUYg at mail dot gmail dot com> <20140603030513 dot GC9120 at redacted dot bos dot redhat dot com>
On 3 June 2014 04:05, Kyle McMartin <email@example.com> wrote:
> Sorry for the delay, been a busy few weeks.
> On Mon, May 19, 2014 at 12:25:55PM +0100, Will Newton wrote:
>> On 14 May 2014 21:54, Kyle McMartin <firstname.lastname@example.org> wrote:
>> > On Wed, May 14, 2014 at 04:32:51PM -0400, Kyle McMartin wrote:
>> > rth points out something more sensible than the if (0) ugliness which I
>> > like better. Thanks!
>> Yes, I think this version looks nicer. I guess you could try using a
>> more complicated #ifdef but I'm not sure if it would be any prettier.
> The nesting makes it significantly worse, better to just let the
> compiler to do the work here, rather than cpp.
>> It looks like it might be possible to abstract these details out into
>> two functions, one for REL and one for RELA. Did you investigate that?
> Not sure I follow you here.
What I meant was that there is a lot of copy and paste here, maybe we
can clean that up. But your patch doesn't make it worse so its fine to
leave that for another day I think.
>> It would be nice to make the test a part of the glibc test suite. It
>> might take a bit of work to translate into the glibc test framework
>> but would be worth it to make sure this area of the dynamic linker
>> gets tested.
> No objection from me, all of this TLS code is very much a
> nest of vipers and corner cases.
>> Is aarch64 the only architecture in this set that uses the gnu2
>> dialect by default? (btw, typo in your commit message
> Yes, it's the only one that uses this default in GCC. And, frankly,
> given how this rtld code falls apart, I don't think anyone has even
> bothered testing it anywhere else, much less used it in production.
I tested the patch on ARM with -mtls-dialect=gnu2 and found one
unrelated glibc bug and two binutils bugs, so yes, it appears to be
lightly used. ;-)
Toolchain Working Group, Linaro