[elfutils] Add upstream xlatetom fix (#835877)

Mark Wielaard mjw at fedoraproject.org
Wed Jul 18 11:20:51 UTC 2012


commit 3152a5394572b1225cb3dc813332242d7b8720f8
Author: Mark Wielaard <mjw at redhat.com>
Date:   Wed Jul 18 13:18:05 2012 +0200

    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(-)
---
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 <pmachata at redhat.com>
+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 <pmachata at redhat.com>
+
+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  <pmachata at redhat.com>
++
++	* 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  <mjw at redhat.com>
+ 
+ 	* 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 <drepper at redhat.com>, 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 <mjw at redhat.com> 0.154-2
+- Add upstream xlatetom fix (#835877)
+
 * Mon Jul 02 2012 Karsten Hopp <karsten at redhat.com> 0.154-1.1
 - disable unstrip-n check for now (835877)
 


More information about the scm-commits mailing list