]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Handle an edge case for minisym TLS variable lookups.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 12 Mar 2019 20:39:02 +0000 (13:39 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 12 Mar 2019 20:45:47 +0000 (13:45 -0700)
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.

gdb/ChangeLog
gdb/solib-svr4.c

index c91e975309160ebf5f8f42bb59be3caeaa308751..f02545254630c9f1ecf94f26688f9398abb6afc3 100644 (file)
@@ -1,3 +1,8 @@
+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
index 84693c17666b9b76fd3a4250fb29f0bca8f7b8a7..14a471b6dc0f9b675297023f65f9e9ae57d155ed 100644 (file)
@@ -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)