summaryrefslogtreecommitdiff
path: root/devel/gdb/files/commit-df22c1e5d5
blob: 70c27c6986b71040ba3a30b589f91d1b878168d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
commit df22c1e5d53c38f38bce6072bb46de240f9e0e2b
Author: John Baldwin <jhb@FreeBSD.org>
Date:   Tue Mar 12 13:39:02 2019 -0700

    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.

diff --git gdb/solib-svr4.c gdb/solib-svr4.c
index 84693c1766..14a471b6dc 100644
--- gdb/solib-svr4.c
+++ 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)