This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [libc patch] __tls_get_addr with link_map * instead of modid
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>, libc-alpha at sourceware dot org
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 23 Oct 2014 22:21:02 -0400
- Subject: Re: [libc patch] __tls_get_addr with link_map * instead of modid
- Authentication-results: sourceware.org; auth=none
- References: <20141018201540 dot GA26252 at host2 dot jankratochvil dot net>
On 10/18/2014 04:15 PM, Jan Kratochvil wrote:
> Other option suggested by Tom Tromey is implemented by this patch:
>
> * A new glibc function like __tls_get_addr that takes a link_map address
> rather than a module id.
I do not think this is a good solution.
If you use this function in jit'd code, you've now deviated from what normal
TLS-accessing sequences look like. Now your code deviates from the published
tls.pdf in the call sequence, and is undocumented, though simple. On top of
that it's a stop-gap measure until we fix things correctly. Because of these
things I object to adding this function to ld's API.
I don't like libthread_db either, but it avoids us having to put a stop-gap
API in ld. I say stop-gap because the real solution is going to be to use
python/DWARF, not any API in ld.
I'm in favour of exactly 3 things:
* New function in libthread_db.
* Heuristics in gdb if libthread_db is not new enough.
* A python or DWARF based parser to replace libthread_db.
Cheers,
Carlos.