0.165-5 - Add elfutils-0.165-nobitsalign-strip.patch.

This commit is contained in:
Mark Wielaard 2016-02-04 16:30:39 +01:00
parent cbe28cdfa0
commit df9a3ff5d9
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,42 @@
Upstream proposed patch.
Note that this backport doesn't actually contain the new testcase.
It is just the elf_getdata fix.
commit edff83d3416a136ce58a21a1244c99805e98f6d8
Author: Mark Wielaard <mjw@redhat.com>
Date: Thu Feb 4 09:53:41 2016 +0100
libelf: elf_getdata should not adjust alignment for SHT_NOBITS sections.
In commit c0748e "libelf: More checking of valid sh_addralign values." we
adjusted bogus alignment of data buffers if they were greater than the
offset of the data in the file. This works OK, except when there is no
data in the file. So make sure to not adjust any NOBITS sections.
Also adds a test that shows the issue and makes sure elflint is called
with --gnu in run-strip-test.sh.
https://bugzilla.redhat.com/show_bug.cgi?id=1303845
Signed-off-by: Mark Wielaard <mjw@redhat.com>
diff --git a/libelf/elf_getdata.c b/libelf/elf_getdata.c
index 4ec94b9..d1fafbf 100644
--- a/libelf/elf_getdata.c
+++ b/libelf/elf_getdata.c
@@ -1,5 +1,5 @@
/* Return the next data element from the section after possibly converting it.
- Copyright (C) 1998-2005, 2006, 2007, 2015 Red Hat, Inc.
+ Copyright (C) 1998-2005, 2006, 2007, 2015, 2016 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 1998.
@@ -363,7 +363,7 @@ __libelf_set_rawdata_wrlock (Elf_Scn *scn)
at least an ehdr this will only trigger for alignment values > 64
which should be uncommon. */
align = align ?: 1;
- if (align > offset)
+ if (type != SHT_NOBITS && align > offset)
align = offset;
scn->rawdata.d.d_align = align;
if (elf->class == ELFCLASS32

View File

@ -1,7 +1,7 @@
Name: elfutils
Summary: A collection of utilities and DSOs to handle compiled objects
Version: 0.165
%global baserelease 4
%global baserelease 5
URL: https://fedorahosted.org/elfutils/
%global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/
License: GPLv3+ and (GPLv2+ or LGPLv3+)
@ -24,6 +24,7 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2
# Needed for older (pre-2.22) glibc (f22 and earlier)
Patch1: elfutils-0.165-elf-libelf.patch
Patch2: elfutils-0.165-reloc.patch
Patch3: elfutils-0.165-nobitsalign-strip.patch
Requires: elfutils-libelf%{depsuffix} = %{version}-%{release}
Requires: elfutils-libs%{depsuffix} = %{version}-%{release}
@ -169,6 +170,7 @@ profiling) of processes.
# Apply patches
%patch1 -p1 -b .elf_libelf
%patch2 -p1 -b .reloc
%patch3 -p1 -b .nobitsalign
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
@ -305,6 +307,9 @@ rm -rf ${RPM_BUILD_ROOT}
%endif
%changelog
* Thu Feb 04 2016 Mark Wielaard <mjw@redhat.com> - 0.165-5
- Add elfutils-0.165-nobitsalign-strip.patch.
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.165-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild