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: Rich Felker <dalias at libc dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, libc-alpha at sourceware dot org, gdb-patches at sourceware dot org
- Date: Sat, 25 Oct 2014 02:26:32 -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> <20141025055516 dot GJ22465 at brightrain dot aerifal dot cx> <20141025061400 dot GA32108 at host2 dot jankratochvil dot net>
On Sat, Oct 25, 2014 at 08:14:00AM +0200, Jan Kratochvil wrote:
> On Sat, 25 Oct 2014 07:55:16 +0200, Rich Felker wrote:
> > On Fri, Oct 24, 2014 at 04:40:14PM +0200, Jan Kratochvil wrote:
> > > I forgot about this possibility - that libthread_db would provide just the
> > > module ID (and not some per-thread address).
> >
> > Why not just use dl_iterate_phdr to get the module id?
>
> I do not see where to find l_tls_modid in the returned data structures.
>
> dl_iterate_phdr is in libc.so.6 (and not libdl.so.2) so that would be OK.
Oh, it looks like it's only available in the BSD version of on the
dl_phdr_info structure. Could we get it added to glibc? See:
http://www.freebsd.org/cgi/man.cgi?query=dl_iterate_phdr&sektion=3&apropos=0&manpath=FreeBSD%2B10.0-RELEASE
This is the version of the structure I accepted for inclusion in musl,
and I don't think I was even aware that glibc lacked these fields.
Rich