0.161-4 Add elfutils-0.161-addralign.patch (#1189928)
This commit is contained in:
parent
268313f406
commit
94ab0ae1a2
53
elfutils-0.161-addralign.patch
Normal file
53
elfutils-0.161-addralign.patch
Normal file
@ -0,0 +1,53 @@
|
||||
commit 6f5934c1afa8f34bfb8f86b191ded9af854e757f
|
||||
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Date: Sat Feb 7 15:08:20 2015 +0100
|
||||
|
||||
libelf: Consider sh_addralign 0 as 1
|
||||
|
||||
Currently the Koji build for arm32 fails with:
|
||||
extracting debug info from /builddir/build/BUILDROOT/etcd-2.0.0-0.3.rc1.fc22.arm/usr/bin/etcd
|
||||
Failed to write file: invalid section alignment
|
||||
|
||||
This is because the binary etcd
|
||||
http://people.redhat.com/jkratoch/etcdctl.xz
|
||||
contains:
|
||||
Section Headers:
|
||||
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
|
||||
[11] .rel.plt REL 00459ee0 449ee0 000088 08 A 13 0 0
|
||||
^
|
||||
which corresponds to golang's code:
|
||||
go/src/cmd/ld/elf.c
|
||||
case EM_X86_64:
|
||||
sh = elfshname(".rela.plt");
|
||||
sh->addralign = RegSize;
|
||||
default:
|
||||
sh = elfshname(".rel.plt");
|
||||
<nothing>
|
||||
|
||||
ELF spec says:
|
||||
Values 0 and 1 mean the section has no alignment constraints.
|
||||
and libelf/elf32_updatenull.c really parses it that way at line 204
|
||||
ElfW2(LIBELFBITS,Word) sh_align = shdr->sh_addralign ?: 1;
|
||||
but unfortunately the later line being patched no longer does.
|
||||
|
||||
libelf/
|
||||
2015-02-07 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* elf32_updatenull.c (__elfw2(LIBELFBITS,updatenull_wrlock)): Consider
|
||||
sh_addralign 0 as 1.
|
||||
|
||||
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
|
||||
index be4cea0..5e809b7 100644
|
||||
--- a/libelf/elf32_updatenull.c
|
||||
+++ b/libelf/elf32_updatenull.c
|
||||
@@ -328,7 +328,7 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
|
||||
enough for the largest alignment required by a data
|
||||
block. */
|
||||
if (unlikely (! powerof2 (shdr->sh_addralign))
|
||||
- || unlikely (shdr->sh_addralign < sh_align))
|
||||
+ || unlikely ((shdr->sh_addralign ?: 1) < sh_align))
|
||||
{
|
||||
__libelf_seterrno (ELF_E_INVALID_ALIGN);
|
||||
return -1;
|
@ -1,7 +1,7 @@
|
||||
Name: elfutils
|
||||
Summary: A collection of utilities and DSOs to handle compiled objects
|
||||
Version: 0.161
|
||||
%global baserelease 3
|
||||
%global baserelease 4
|
||||
URL: https://fedorahosted.org/elfutils/
|
||||
%global source_url http://fedorahosted.org/releases/e/l/elfutils/%{version}/
|
||||
License: GPLv3+ and (GPLv2+ or LGPLv3+)
|
||||
@ -49,6 +49,8 @@ Patch1: %{?source_url}elfutils-portability-%{version}.patch
|
||||
Patch2: elfutils-0.161-ar-long-name.patch
|
||||
# libdw: fix offset for sig8 lookup in dwarf_formref_die
|
||||
Patch3: elfutils-0.161-formref-type.patch
|
||||
# rhbz#1189928 - Consider sh_addralign 0 as 1
|
||||
Patch4: elfutils-0.161-addralign.patch
|
||||
|
||||
%if !%{compat}
|
||||
Release: %{baserelease}%{?dist}
|
||||
@ -213,6 +215,7 @@ sed -i.scanf-m -e 's/%m/%a/g' src/addr2line.c tests/line2addr.c
|
||||
|
||||
%patch2 -p1 -b .ar_long_name
|
||||
%patch3 -p1 -b .formref_type
|
||||
%patch4 -p1 -b .addralign
|
||||
|
||||
find . -name \*.sh ! -perm -0100 -print | xargs chmod +x
|
||||
|
||||
@ -341,6 +344,9 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
%{_libdir}/libelf.a
|
||||
|
||||
%changelog
|
||||
* Sat Feb 07 2015 Mark Wielaard <mjw@redhat.com> - 0.161-4
|
||||
- Add elfutils-0.161-addralign.patch (#1189928)
|
||||
|
||||
* Thu Feb 05 2015 Mark Wielaard <mjw@redhat.com> - 0.161-3
|
||||
- Add elfutils-0.161-formref-type.patch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user