summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx32
1 files changed, 25 insertions, 7 deletions
diff --git a/translate.cxx b/translate.cxx
index 17c37dc3..f4c28536 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4497,17 +4497,35 @@ dump_unwindsyms (Dwfl_Module *m,
// see https://bugzilla.redhat.com/show_bug.cgi?id=465872
// and http://sourceware.org/ml/systemtap/2008-q4/msg00579.html
#ifdef _ELFUTILS_PREREQ
-#if _ELFUTILS_PREREQ(0,138)
+ #if _ELFUTILS_PREREQ(0,138)
// Let's standardize to the buggy "end of build-id bits" behavior.
build_id_vaddr += build_id_len;
+ #endif
+ #if !_ELFUTILS_PREREQ(0,141)
+ #define NEED_ELFUTILS_BUILDID_WORKAROUND
+ #endif
+#else
+ #define NEED_ELFUTILS_BUILDID_WORKAROUND
#endif
+
+ // And check for another workaround needed.
+ // see https://bugzilla.redhat.com/show_bug.cgi?id=489439
+ // and http://sourceware.org/ml/systemtap/2009-q1/msg00513.html
+#ifdef NEED_ELFUTILS_BUILDID_WORKAROUND
+ if (build_id_vaddr < base && dwfl_module_relocations (m) == 1)
+ {
+ GElf_Addr main_bias;
+ dwfl_module_getelf (m, &main_bias);
+ build_id_vaddr += main_bias;
+ }
#endif
- if (c->session.verbose > 1) {
- clog << "Found build-id in " << name
- << ", length " << build_id_len;
- clog << ", end at 0x" << hex << build_id_vaddr
- << dec << endl;
- }
+ if (c->session.verbose > 1)
+ {
+ clog << "Found build-id in " << name
+ << ", length " << build_id_len;
+ clog << ", end at 0x" << hex << build_id_vaddr
+ << dec << endl;
+ }
}
// Look up the relocation basis for symbols