diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-02-21 00:40:23 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-02-21 00:40:23 +0100 |
commit | 7774095b25424019098226eaa7c1148ff24b800b (patch) | |
tree | 4b896451404ddf11ca306f6a5ec014d42861ed2b | |
parent | d25f3d880946be8fc5d09d8d365612b5efda825a (diff) | |
download | systemtap-steved-7774095b25424019098226eaa7c1148ff24b800b.tar.gz systemtap-steved-7774095b25424019098226eaa7c1148ff24b800b.tar.xz systemtap-steved-7774095b25424019098226eaa7c1148ff24b800b.zip |
Adjust ET_DYN symbol addresses against module base.
* translate.cxx (dump_unwindsyms): Adjust sym_addr for ET_DYN always
against module base as workaround for buggy elfutils < 0.138.
-rw-r--r-- | translate.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/translate.cxx b/translate.cxx index c0e76a02..530b077d 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4551,10 +4551,19 @@ dump_unwindsyms (Dwfl_Module *m, if (n > 0) // only try to relocate if there exist relocation bases { + Dwarf_Addr save_addr = sym_addr; int ki = dwfl_module_relocate_address (m, &sym_addr); dwfl_assert ("dwfl_module_relocate_address", ki >= 0); secname = dwfl_module_relocation_info (m, ki, NULL); - } + + // For ET_DYN files (secname == "") we do ignore the + // dwfl_module_relocate_address adjustment. libdwfl + // up to 0.137 would substract the wrong bias. So we do + // it ourself, it is always just the module base address + // in this case. + if (ki == 0 && secname != NULL && secname[0] == '\0') + sym_addr = save_addr - base; + } if (n == 1 && modname == "kernel") { |