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>
- Cc: libc-alpha at sourceware dot org, gdb-patches at sourceware dot org
- Date: Fri, 24 Oct 2014 10:59:55 -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> <5449B78E dot 1060407 at redhat dot com> <20141024093834 dot GA24090 at host2 dot jankratochvil dot net> <544A60A5 dot 4020701 at redhat dot com> <20141024144014 dot GA2193 at host2 dot jankratochvil dot net>
On 10/24/2014 10:40 AM, Jan Kratochvil wrote:
> On Fri, 24 Oct 2014 16:22:29 +0200, Carlos O'Donell wrote:
>> What's wrong with using libthread_db to get the module ID and then you can
>> call the normal TLS functions
> +
>> Isn't a solution to use libthread_db to get the module ID from the link_map,
>> then use that with normal __tls_get_addr instead of adding to ld's API?
>
> I forgot about this possibility - that libthread_db would provide just the
> module ID (and not some per-thread address).
>
> Therefore going to post a libthread_db patch later, instead of using
> _dl_tls_get_addr_soft() which would have one disadvantage I described before
> to Alex.
That sounds good to me. If you remember I promised you that I'd implement this,
but I haven't gotten to it yet. If you want to implement it, please go ahead,
otherwise I'll get to adding the function to libthread_db and testing. Right
now though I'm handling other deeper issues (dlopen recursion). So any help
you're willing to give is appreciated. I'm happy to review patches.
>> What I oppose is the addition to ld's ABI and API something which is not going
>> to be a permanent solution, and for which we can put a function somewhere
>> else and get similar results.
>
> IMO the dlopen() way could be the first simple solution, extending it
> optionally only upon demand later. Going now back to dlopen() seems a bit
> backwards to me.
I don't judge you. That is a decision the gdb community has to make. It sounds
like you've made it. I'm here to help :-)
Cheers,
Carlos.