From 44469eb60709d4badbb77e31fb47dc98ef1ca10a Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Wed, 4 Oct 2017 21:36:34 -0400 Subject: [PATCH] Fix swbz22248, handle R_*_IRELATIV, swbz22004, ignore linux-vdso64.so.1 --- Object-elf.patch | 29 +++++++++++++++++++++++++++++ addrtranslate-sysv.patch | 12 ++++++++++++ dyninst.spec | 9 ++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 Object-elf.patch create mode 100644 addrtranslate-sysv.patch diff --git a/Object-elf.patch b/Object-elf.patch new file mode 100644 index 0000000..c579ddb --- /dev/null +++ b/Object-elf.patch @@ -0,0 +1,29 @@ +# workaround for https://github.com/dyninst/dyninst/issues/396 + +--- ./dyninst-9.3.2/symtabAPI/src/Object-elf.C.sv 2017-09-27 21:43:18.399429243 -0400 ++++ ./dyninst-9.3.2/symtabAPI/src/Object-elf.C 2017-09-27 21:56:14.485125928 -0400 +@@ -1445,6 +1445,24 @@ + if (fbt_iter == -1) { // Create new relocation entry. + relocationEntry re( next_plt_entry_addr, offset, targ_name, + NULL, type ); ++ if (type == R_X86_64_IRELATIVE) { ++ vector funcs; ++ dyn_hash_map >::iterator iter; ++ // find the resolver function and use that as the ++ // caller function symbol. The resolver has not run ++ // so we don't know the ultimate destination. ++ // Since the funcsByOffset map hasn't been setup yet ++ // we cannot call associated_symtab->findFuncByEntryOffset ++ for (iter = symbols_.begin(); iter != symbols_.end(); ++iter) { ++ std::string name = iter->first; ++ Symbol *sym = iter->second[0]; ++ if (sym->getOffset() == (Offset)addend) { ++ // Use dynsym_list.push_back(sym) instead? ++ re.addDynSym(sym); ++ break; ++ } ++ } ++ } + re.setAddend(addend); + re.setRegionType(rtype); + if (dynsym_list.size() > 0) diff --git a/addrtranslate-sysv.patch b/addrtranslate-sysv.patch new file mode 100644 index 0000000..3de3a53 --- /dev/null +++ b/addrtranslate-sysv.patch @@ -0,0 +1,12 @@ +# workaround for https://github.com/dyninst/dyninst/issues/406 + +--- dyninst-9.3.2/common/src/addrtranslate-sysv.C.sv 2017-10-03 21:32:23.608614189 -0400 ++++ dyninst-9.3.2/common/src/addrtranslate-sysv.C 2017-10-03 21:33:36.538642148 -0400 +@@ -800,6 +800,7 @@ + continue; + } + if (obj_name == "linux-vdso.so.1" || ++ obj_name == "linux-vdso64.so.1" || + obj_name == "linux-gate.so.1") + { + continue; diff --git a/dyninst.spec b/dyninst.spec index 93472bf..d121e42 100644 --- a/dyninst.spec +++ b/dyninst.spec @@ -2,7 +2,7 @@ Summary: An API for Run-time Code Generation License: LGPLv2+ Name: dyninst Group: Development/Libraries -Release: 6%{?dist} +Release: 7%{?dist} URL: http://www.dyninst.org Version: 9.3.2 # Dyninst only has full support for a few architectures. @@ -15,6 +15,8 @@ Source0: https://github.com/dyninst/dyninst/archive/v%{version}/dyninst-%{versio Source1: https://github.com/dyninst/testsuite/archive/v9.3.0/testsuite-9.3.0.tar.gz Patch1: testsuite-9.3.0-junit-nullptr.patch +Patch2: addrtranslate-sysv.patch +Patch3: Object-elf.patch %global dyninst_base dyninst-%{version} # Explicit version since it does not match the source version @@ -88,6 +90,8 @@ making sure that dyninst works properly. %setup -q -T -D -a 1 %patch1 -p0 -b.nullptr +%patch2 -p0 -b.addrtrans +%patch3 -p0 -b.objelf # cotire seems to cause non-deterministic gcc errors # https://bugzilla.redhat.com/show_bug.cgi?id=1420551 @@ -181,6 +185,9 @@ find %{buildroot}%{_libdir}/dyninst/testsuite/ \ %attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a %changelog +* Wed Oct 04 2017 Stan Cox - 9.3.2-7 +- Fix swbz22248, handle R_*_IRELATIV, swbz22004, ignore linux-vdso64.so.1 + * Sun Aug 06 2017 Björn Esser - 9.3.2-6 - Rebuilt for AutoReq cmake-filesystem