This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>, Pedro Alves <palves at redhat dot com>
- Date: Tue, 25 Aug 2015 20:22:12 +0200
- Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1
- Authentication-results: sourceware.org; auth=none
- References: <20090406203920 dot CCD6F19C4EC at localhost> <20150825180100 dot GA30888 at host1 dot jankratochvil dot net> <CALoOobMh5payCOmGj_=0mSWNyua5ifih4Mc2iQ6kJBhL5tpiTw at mail dot gmail dot com>
On Tue, 25 Aug 2015 20:13:54 +0200, Paul Pluzhnikov wrote:
> We've had a lot of systems where installed /lib64/libthread_db was
> from glibc-2.7, while target binary was using glibc-2.3.6, and I am
> 99.99% sure that combination didn't work.
Pedro explained that glibc also does:
# $ grep -rn nptl_version nptl*
# nptl/ChangeLog.old:7461: * init.c (nptl_version): Add __attribute_used__ to nptl_version.
# nptl/nptl-init.c:68:static const char nptl_version[] __attribute_used__ = VERSION;
# nptl_db/td_ta_new.c:42: if (td_lookup (ps, SYM_nptl_version, &versaddr) != PS_OK)
# nptl_db/structs.def:53:DB_SYMBOL (nptl_version)
#
# So that alone makes a libthread_db.so for glibc 2.x refuse to work with glibc 2.y.
BTW the nptl_version check seems to predate the _thread_db_* symbols.
Thanks,
Jan