TLS variables access for -static -lpthread executables
Jan Kratochvil
jan.kratochvil@redhat.com
Thu Mar 27 18:18:00 GMT 2014
On Thu, 27 Mar 2014 08:45:21 +0100, Carlos O'Donell wrote:
> The best way forward would be to ensure you can get a link map even for
> static executables, and then use that with td_thr_tls_get_addr(). This
> would allow gdb to avoid doing two different things for static and
> dynamic executables. It also helps all other applications using libthread_db
> interfaces.
>
> Would you mind testing something like this in fedora rawhide?
Yes, it works for me. Just one has to additionally used the attached patch.
The -static -pthread executable does not have ".dynamic" section so GDB
thinks the main executable cannot be present in link_map.
How to fix this compatibility is a topic for upstream GDB, I am not sure how
the patch is compatible with other SVR4 OSes (like Solaris).
Thanks,
Jan
More information about the Libc-help
mailing list