aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2019-03-12 13:39:02 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2019-03-12 13:45:47 -0700
commitdf22c1e5d53c38f38bce6072bb46de240f9e0e2b (patch)
treebeda22cdcf7521cbc910703085ff5be17a8eb708
parentdd6876c91cd40cc105b1a91f418ca2c80683b314 (diff)
downloadgdb-df22c1e5d53c38f38bce6072bb46de240f9e0e2b.zip
gdb-df22c1e5d53c38f38bce6072bb46de240f9e0e2b.tar.gz
gdb-df22c1e5d53c38f38bce6072bb46de240f9e0e2b.tar.bz2
Handle an edge case for minisym TLS variable lookups.
If a TLS variable is provided by a minisym from a separate debug file, the separate debug file is passed to gdbarch_fetch_tls_load_module_address. However, the object files stored in the shared object list are the original object files, not the separate debug object files. In this case, svr4_fetch_objfile_link_map was failing to find the link map entry since the debug object file is not in its internal list, only the original object file. gdb/ChangeLog: * solib-svr4.c (svr4_fetch_objfile_link_map): Look for objfile->separate_debug_objfile_backlink if not NULL.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/solib-svr4.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c91e975..f025452 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-03-12 John Baldwin <jhb@FreeBSD.org>
+ * solib-svr4.c (svr4_fetch_objfile_link_map): Look for
+ objfile->separate_debug_objfile_backlink if not NULL.
+
+2019-03-12 John Baldwin <jhb@FreeBSD.org>
+
* amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Use
tdep->fsbase_regnum instead of constants for fs_base and gs_base.
(amd64bsd_store_inferior_registers): Likewise.
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 84693c1..14a471b 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1551,6 +1551,11 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
if (objfile == symfile_objfile)
return info->main_lm_addr;
+ /* If OBJFILE is a separate debug object file, look for the
+ original object file. */
+ if (objfile->separate_debug_objfile_backlink != NULL)
+ objfile = objfile->separate_debug_objfile_backlink;
+
/* The other link map addresses may be found by examining the list
of shared libraries. */
for (so = master_so_list (); so; so = so->next)