app-forensics/honggfuzz: tweak for binutils-2.34, bug #707846
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 2 Feb 2020 11:28:11 +0000 (11:28 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Sun, 2 Feb 2020 11:28:57 +0000 (11:28 +0000)
Reported-by: Toralf Förster
Closes: https://bugs.gentoo.org/707846
Package-Manager: Portage-2.3.87, Repoman-2.3.20
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
app-forensics/honggfuzz/files/honggfuzz-2.0-binutils-2.34.patch [new file with mode: 0644]
app-forensics/honggfuzz/honggfuzz-2.0.ebuild

diff --git a/app-forensics/honggfuzz/files/honggfuzz-2.0-binutils-2.34.patch b/app-forensics/honggfuzz/files/honggfuzz-2.0-binutils-2.34.patch
new file mode 100644 (file)
index 0000000..45da65c
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/linux/bfd.c
++++ b/linux/bfd.c
+@@ -122,8 +122,8 @@ void arch_bfdDemangle(funcs_t* funcs, size_t funcCnt) {
+ static struct bfd_section* arch_getSectionForPc(bfd* bfdh, uint64_t pc) {
+     for (struct bfd_section* section = bfdh->sections; section; section = section->next) {
+-        uintptr_t vma = (uintptr_t)bfd_get_section_vma(bfdh, section);
+-        uintptr_t sz = (uintptr_t)bfd_get_section_size(section);
++        uintptr_t vma = (uintptr_t)bfd_section_vma(section);
++        uintptr_t sz = (uintptr_t)bfd_section_size(section);
+         if ((pc > vma) && (pc < (vma + sz))) {
+             return section;
+         }
+@@ -160,7 +160,7 @@ void arch_bfdResolveSyms(pid_t pid, funcs_t* funcs, size_t num) {
+             continue;
+         }
+-        long sec_offset = (long)funcs[i].pc - bfd_get_section_vma(bfdParams.bfdh, section);
++        long sec_offset = (long)funcs[i].pc - bfd_section_vma(section);
+         if (bfd_find_nearest_line(
+                 bfdParams.bfdh, section, bfdParams.syms, sec_offset, &file, &func, &line) == TRUE) {
index f486d019eb3ba92082411aa934a4cf751c1b48fc..f58c1b9e7c81e7ee30bc2b293822de1f192e30b1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -33,6 +33,14 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.1-binutils-2.29.patch
 )
 
+src_prepare() {
+       default
+
+       if has_version ">=sys-libs/binutils-libs-2.34"; then
+               eapply "${FILESDIR}"/${PN}-2.0-binutils-2.34.patch
+       fi
+}
+
 src_compile() {
        CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" emake
 }