diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-03-16 14:19:20 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-03-16 14:19:20 +0100 |
commit | 1bb61ae1fd02086560f5cd019db320b5a217ba05 (patch) | |
tree | ba14f83251b9081b9c5d0f9743f27437ce8dbf2c /translate.cxx | |
parent | 8552ab0f6699553a519a8f96d4356ac17f031230 (diff) | |
download | systemtap-steved-1bb61ae1fd02086560f5cd019db320b5a217ba05.tar.gz systemtap-steved-1bb61ae1fd02086560f5cd019db320b5a217ba05.tar.xz systemtap-steved-1bb61ae1fd02086560f5cd019db320b5a217ba05.zip |
Add workaround for dwfl_module_build_id bug with elfutils < 0.140.
* translate.cxx (dump_unwindsyms): Check elfutils version and whether
build_id_vaddr < base, and if so add main_bias to address.
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 32 |
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 |