summaryrefslogtreecommitdiffstats
path: root/translate.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'translate.cxx')
-rw-r--r--translate.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/translate.cxx b/translate.cxx
index cdc3da84..cce76db6 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -26,6 +26,9 @@
extern "C" {
#include <elfutils/libdwfl.h>
+#ifdef HAVE_ELFUTILS_VERSION_H
+#include <elfutils/version.h>
+#endif
}
using namespace std;
@@ -4475,8 +4478,15 @@ dump_unwindsyms (Dwfl_Module *m,
(const unsigned char **)&build_id_bits,
&build_id_vaddr)) > 0)
{
- /* XXX: But see https://bugzilla.redhat.com/show_bug.cgi?id=465872;
- dwfl_module_build_id was not intended to return the end address. */
+ // Enable workaround for elfutils dwfl bug.
+ // 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)
+ // Let's standardize to the buggy "end of build-id bits" behavior.
+ build_id_vaddr += build_id_len;
+#endif
+#endif
if (c->session.verbose > 1) {
clog << "Found build-id in " << name
<< ", length " << build_id_len;