This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libc patch] __tls_get_addr with link_map * instead of modid


On Oct 18, 2014, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:

> * A new glibc function like __tls_get_addr that takes a link_map address
>   rather than a module id.

dlinfo offers operations to both map a link_map (AKA dlopen handle) to
the modid, and to get the TLS base address for that link_map.  I suppose
calling dlinfo directly is not an option, since there's no guarantee
that libdl will have been linked in.

However, the implementat of dlinfo RTLD_DI_TLS_DATA relies on
_dl_tls_get_addr_soft, that not only takes a struct link_map*, but also
refrains from assigning a TLS segment for the module in the running
thread when one isn't allocated already.  I think this would be
preferrable behavior for a debugger, to avoid heisenbugs.

This symbol is not exported by ld.so, but this shouldn't stop GDB from
using it, since it is present in the symbol table as a local (hidden)
symbol.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]