From 3152a5394572b1225cb3dc813332242d7b8720f8 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 18 Jul 2012 13:18:05 +0200 Subject: [PATCH] Add upstream xlatetom fix (#835877) --- elfutils-0.154-nounstripcheck-835877.patch | 42 ------------------- elfutils-0.154-xlatetom-835877.patch | 48 ++++++++++++++++++++++ elfutils.spec | 11 ++--- 3 files changed, 54 insertions(+), 47 deletions(-) delete mode 100644 elfutils-0.154-nounstripcheck-835877.patch create mode 100644 elfutils-0.154-xlatetom-835877.patch diff --git a/elfutils-0.154-nounstripcheck-835877.patch b/elfutils-0.154-nounstripcheck-835877.patch deleted file mode 100644 index 043941c..0000000 --- a/elfutils-0.154-nounstripcheck-835877.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -up elfutils-0.154/tests/Makefile.am.835877 elfutils-0.154/tests/Makefile.am ---- elfutils-0.154/tests/Makefile.am.835877 2012-07-02 07:20:15.050457120 -0400 -+++ elfutils-0.154/tests/Makefile.am 2012-07-02 07:21:01.880423371 -0400 -@@ -79,7 +79,7 @@ TESTS = run-arextract.sh run-arsymtest.s - run-early-offscn.sh run-dwarf-getmacros.sh \ - run-test-flag-nobits.sh run-prelink-addr-test.sh \ - run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \ -- run-readelf-d.sh run-unstrip-n.sh run-low_high_pc.sh -+ run-readelf-d.sh run-low_high_pc.sh - - if !STANDALONE - noinst_PROGRAMS += msg_tst md5-sha1-test -@@ -156,7 +156,7 @@ EXTRA_DIST = run-arextract.sh run-arsymt - testfile56.bz2 testfile57.bz2 testfile58.bz2 \ - run-typeiter.sh testfile59.bz2 \ - run-readelf-d.sh testlib_dynseg.so.bz2 \ -- run-unstrip-n.sh testcore-rtlib.bz2 \ -+ testcore-rtlib.bz2 \ - run-low_high_pc.sh testfile_low_high_pc.bz2 - - installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ -diff -up elfutils-0.154/tests/Makefile.in.835877 elfutils-0.154/tests/Makefile.in ---- elfutils-0.154/tests/Makefile.in.835877 2012-07-02 07:20:07.830415701 -0400 -+++ elfutils-0.154/tests/Makefile.in 2012-07-02 07:20:49.900433188 -0400 -@@ -87,7 +87,7 @@ TESTS = run-arextract.sh run-arsymtest.s - run-dwarf-getmacros.sh run-test-flag-nobits.sh \ - run-prelink-addr-test.sh run-dwarf-getstring.sh \ - run-rerequest_tag.sh run-typeiter.sh run-readelf-d.sh \ -- run-unstrip-n.sh run-low_high_pc.sh $(am__EXEEXT_1) \ -+ run-low_high_pc.sh $(am__EXEEXT_1) \ - $(am__EXEEXT_3) - @STANDALONE_FALSE@am__append_5 = msg_tst md5-sha1-test - @STANDALONE_FALSE@am__append_6 = msg_tst md5-sha1-test -@@ -575,7 +575,7 @@ EXTRA_DIST = run-arextract.sh run-arsymt - testfile56.bz2 testfile57.bz2 testfile58.bz2 \ - run-typeiter.sh testfile59.bz2 \ - run-readelf-d.sh testlib_dynseg.so.bz2 \ -- run-unstrip-n.sh testcore-rtlib.bz2 \ -+ testcore-rtlib.bz2 \ - run-low_high_pc.sh testfile_low_high_pc.bz2 - - installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \ diff --git a/elfutils-0.154-xlatetom-835877.patch b/elfutils-0.154-xlatetom-835877.patch new file mode 100644 index 0000000..d42ee6f --- /dev/null +++ b/elfutils-0.154-xlatetom-835877.patch @@ -0,0 +1,48 @@ +commit bc0f7450cb0fd5717f532bce1b39f45312cc2fd9 +Author: Petr Machata +Date: Tue Jul 17 16:29:18 2012 +0200 + + elf*_xlatetom: do not check ELF_T_NHDR has integer number of records + + See this bug report for more details: + https://bugzilla.redhat.com/show_bug.cgi?id=835877 + + Signed-off-by: Petr Machata + +diff --git a/libelf/ChangeLog b/libelf/ChangeLog +index 89dd35f..0a6bcba 100644 +--- a/libelf/ChangeLog ++++ b/libelf/ChangeLog +@@ -1,3 +1,8 @@ ++2012-07-17 Petr Machata ++ ++ * elf32_xlatetom.c (elfw2(LIBELFBITS, xlatetom)): Do not check for ++ integer number of records in case of ELF_T_NHDR. ++ + 2012-04-02 Mark Wielaard + + * elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET unless +diff --git a/libelf/elf32_xlatetom.c b/libelf/elf32_xlatetom.c +index 8fdf09d..368df07 100644 +--- a/libelf/elf32_xlatetom.c ++++ b/libelf/elf32_xlatetom.c +@@ -1,5 +1,5 @@ + /* Convert from file to memory representation. +- Copyright (C) 1998, 1999, 2000, 2002 Red Hat, Inc. ++ Copyright (C) 1998, 1999, 2000, 2002, 2012 Red Hat, Inc. + This file is part of elfutils. + Written by Ulrich Drepper , 1998. + +@@ -59,7 +59,11 @@ elfw2(LIBELFBITS, xlatetom) (dest, src, encode) + #endif + + +- if (src->d_size % recsize != 0) ++ /* We shouldn't require integer number of records when processing ++ notes. Payload bytes follow the header immediately, it's not an ++ array of records as is the case otherwise. */ ++ if (src->d_type != ELF_T_NHDR ++ && src->d_size % recsize != 0) + { + __libelf_seterrno (ELF_E_INVALID_DATA); + return NULL; diff --git a/elfutils.spec b/elfutils.spec index af2d7ce..2161c98 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,7 +1,7 @@ Name: elfutils Summary: A collection of utilities and DSOs to handle compiled objects Version: 0.154 -%global baserelease 1.1 +%global baserelease 2 URL: https://fedorahosted.org/elfutils/ %global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/ License: GPLv3+ and (GPLv2+ or LGPLv3+) @@ -46,9 +46,7 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2 Patch1: %{?source_url}elfutils-robustify.patch Patch2: %{?source_url}elfutils-portability.patch Patch3: elfutils-0.154-binutils-pr-ld-13621.patch -%ifarch ppc %{power64} s390 s390x -Patch4: elfutils-0.154-nounstripcheck-835877.patch -%endif +Patch4: elfutils-0.154-xlatetom-835877.patch %if !%{compat} Release: %{baserelease}%{?dist} @@ -214,7 +212,7 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c %endif %patch3 -p1 -b .binutils-pr-ld-13621 -%patch4 -p1 -b .nounstripcheck-835877 +%patch4 -p1 -b .xlatetom-835877 find . -name \*.sh ! -perm -0100 -print | xargs chmod +x @@ -331,6 +329,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/libelf.a %changelog +* Mon Jul 18 2012 Mark Wielaard 0.154-2 +- Add upstream xlatetom fix (#835877) + * Mon Jul 02 2012 Karsten Hopp 0.154-1.1 - disable unstrip-n check for now (835877)