From 156767db6bb4432926b86acb75277cbfad5fae13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Sun, 6 May 2012 08:50:26 +0000 Subject: [PATCH] - small upstream fixes for elflint bug (http://sourceware.org/bugzilla/show_bug.cgi?id=12945). Changed files: elfutils-upstream.patch -> 1.1 elfutils.spec -> 1.102 --- elfutils-upstream.patch | 45 +++++++++++++++++++++++++++++++++++++++++ elfutils.spec | 2 ++ 2 files changed, 47 insertions(+) create mode 100644 elfutils-upstream.patch diff --git a/elfutils-upstream.patch b/elfutils-upstream.patch new file mode 100644 index 0000000..bf209e7 --- /dev/null +++ b/elfutils-upstream.patch @@ -0,0 +1,45 @@ +commit 738c18312e0db36dce5e1cd2cddaf66eb8947f1a +Author: Roland McGrath +Date: Wed Mar 28 15:01:49 2012 -0700 + + elflint: Accept SHF_INFO_LINK for reloc sections. + +commit 191d1f0b9163593eee8c4f5cbe3e95cabf6ae9a9 +Author: Mark Wielaard +Date: Mon Apr 2 17:11:25 2012 +0200 + + elf32_offscn.c: Do not match SHT_NOBITS sections at OFFSET. + + readelf -d doesn't work if a SHT_NOBITS section is right before the actual + .dynamic section at the same offset. elflint also fails on such binaries. + So skip SHT_NOBITS sections at the same offset in [g]elf[32|64]_offscn(). + +diff --git a/src/elflint.c b/src/elflint.c +index abca8b7..a03caac 100644 +--- a/src/elflint.c ++++ b/src/elflint.c +@@ -3357,8 +3357,8 @@ static const struct + { ".note", 6, SHT_NOTE, atleast, 0, SHF_ALLOC }, + { ".plt", 5, SHT_PROGBITS, unused, 0, 0 }, // XXX more tests + { ".preinit_array", 15, SHT_PREINIT_ARRAY, exact, SHF_ALLOC | SHF_WRITE, 0 }, +- { ".rela", 5, SHT_RELA, atleast, 0, SHF_ALLOC }, // XXX more tests +- { ".rel", 4, SHT_REL, atleast, 0, SHF_ALLOC }, // XXX more tests ++ { ".rela", 5, SHT_RELA, atleast, 0, SHF_ALLOC | SHF_INFO_LINK }, // XXX more tests ++ { ".rel", 4, SHT_REL, atleast, 0, SHF_ALLOC | SHF_INFO_LINK }, // XXX more tests + { ".rodata", 8, SHT_PROGBITS, atleast, SHF_ALLOC, SHF_MERGE | SHF_STRINGS }, + { ".rodata1", 9, SHT_PROGBITS, atleast, SHF_ALLOC, SHF_MERGE | SHF_STRINGS }, + { ".shstrtab", 10, SHT_STRTAB, exact, 0, 0 }, +diff --git a/libelf/elf32_offscn.c b/libelf/elf32_offscn.c +index 86eff8b..5dcfc4a 100644 +--- a/libelf/elf32_offscn.c ++++ b/libelf/elf32_offscn.c +@@ -101,7 +101,8 @@ elfw2(LIBELFBITS,offscn) (elf, offset) + /* If this section is empty, the following one has the same + sh_offset. We presume the caller is looking for a nonempty + section, so keep looking if this one is empty. */ +- if (runp->data[i].shdr.ELFW(e,LIBELFBITS)->sh_size != 0) ++ if (runp->data[i].shdr.ELFW(e,LIBELFBITS)->sh_size != 0 ++ && runp->data[i].shdr.ELFW(e,LIBELFBITS)->sh_type != SHT_NOBITS) + goto out; + } + diff --git a/elfutils.spec b/elfutils.spec index a018b46..9ff3e16 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -21,6 +21,7 @@ Patch6: %{name}-sparc.patch Patch7: %{name}-inline.patch Patch8: %{name}-scanf.patch Patch9: %{name}-strings_c.patch +Patch10: %{name}-upstream.patch URL: https://fedorahosted.org/elfutils/ BuildRequires: autoconf >= 2.59 BuildRequires: automake >= 1:1.7 @@ -144,6 +145,7 @@ programowalny interfejs asemblera. %patch7 -p1 %patch8 -p1 %patch9 -p0 +%patch10 -p1 %{__rm} po/stamp-po -- 2.44.0