]> sourceware.org Git - systemtap.git/commitdiff
PR10812: relocate module build-id
authorTony Jones <tonyj@suse.de>
Wed, 29 Sep 2010 16:47:52 +0000 (12:47 -0400)
committerFrank Ch. Eigler <fche@elastic.org>
Wed, 29 Sep 2010 16:47:52 +0000 (12:47 -0400)
Relocate the build_id_vaddr obtained from dwfl_module_build_id.  Failure to
do this was causing ppc64 systems to fail the build-id check for cases such as:

probe module("libata").function("*").call {
  printf ("%s\n", probefunc())
}

Signed-off-by: Tony Jones <tonyj@suse.de>
translate.cxx

index 208b2595814493752f098d3334bde0cc43377cb3..cfdec5bc3ef8c1f565191ae19a6f247fb88a7fe9 100644 (file)
@@ -4911,6 +4911,22 @@ dump_unwindsyms (Dwfl_Module *m,
         build_id_vaddr += main_bias;
       }
 #endif
+
+    if (modname != "kernel") {
+       Dwarf_Addr reloc_vaddr = build_id_vaddr;
+       const char *secname;
+       int i;
+
+       i = dwfl_module_relocate_address (m, &reloc_vaddr);
+       dwfl_assert ("dwfl_module_relocate_address", i >= 0);
+
+       secname = dwfl_module_relocation_info (m, i, NULL);
+       dwfl_assert ("dwfl_module_relocation_info", 
+               strcmp(secname, ".note.gnu.build-id") == 0);
+
+       build_id_vaddr = reloc_vaddr;
+    }
+
     if (c->session.verbose > 1)
       {
         clog << "Found build-id in " << name
This page took 0.032112 seconds and 5 git commands to generate.