diff --git a/elfutils-0.173-annobingroup.patch b/elfutils-0.173-annobingroup.patch new file mode 100644 index 0000000..8b112b5 --- /dev/null +++ b/elfutils-0.173-annobingroup.patch @@ -0,0 +1,30 @@ +commit 73e83285fbeac648edb60a0c4767fad9d470cf0a +Author: Mark Wielaard +Date: Sat Jul 21 23:40:11 2018 +0200 + + unstrip: Handle SHT_GROUP sections in ET_REL files. + + SHT_GROUP sections are put in both the stripped and debug file. + Handle correcting the symbol table/name entry of the group only once. + + The testfile was generated with the gcc annobin plugin. + + Signed-off-by: Mark Wielaard + +diff --git a/src/unstrip.c b/src/unstrip.c +index 057efef..cb1f7dc 100644 +--- a/src/unstrip.c ++++ b/src/unstrip.c +@@ -563,7 +563,11 @@ adjust_all_relocs (Elf *elf, Elf_Scn *symtab, const GElf_Shdr *symshdr, + GElf_Shdr shdr_mem; + GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + ELF_CHECK (shdr != NULL, _("cannot get section header: %s")); +- if (shdr->sh_type != SHT_NOBITS && shdr->sh_link == new_sh_link) ++ /* Don't redo SHT_GROUP, groups are in both the stripped and debug, ++ it will already have been done by adjust_relocs for the ++ stripped_symtab. */ ++ if (shdr->sh_type != SHT_NOBITS && shdr->sh_type != SHT_GROUP ++ && shdr->sh_link == new_sh_link) + adjust_relocs (scn, scn, shdr, map, symshdr); + } + } diff --git a/elfutils.spec b/elfutils.spec index 56795b0..ed7e4ae 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,7 +1,7 @@ Name: elfutils Summary: A collection of utilities and DSOs to handle ELF files and DWARF data Version: 0.173 -%global baserelease 4 +%global baserelease 5 URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ License: GPLv3+ and (GPLv2+ or LGPLv3+) @@ -22,6 +22,7 @@ Source: %{?source_url}%{name}-%{version}.tar.bz2 # Patches Patch1: elfutils-0.173-new-notes-hack.patch Patch2: elfutils-0.173-elfcompress.patch +Patch3: elfutils-0.173-annobingroup.patch Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} Requires: elfutils-libs%{depsuffix} = %{version}-%{release} @@ -33,6 +34,7 @@ BuildRequires: bzip2 BuildRequires: gcc >= 4.4 # For libstdc++ demangle support BuildRequires: libstdc++-devel +BuildRequires: gcc-c++ BuildRequires: zlib-devel >= 1.2.2.3 BuildRequires: bzip2-devel @@ -192,6 +194,7 @@ profiling) of processes. # Apply patches %patch1 -p1 -b .notes_hack %patch2 -p1 -b .elfcompress +%patch3 -p1 -b .annobingroup # In case the above patches added any new test scripts, make sure they # are executable. @@ -324,6 +327,10 @@ fi %endif %changelog +* Sat Jul 21 2018 Mark Wielaard - 0.173-5 +- Add BuildRequires gcc-c++ for demangle support. +- Add elfutils-0.173-annobingroup.patch. + * Sat Jul 21 2018 Mark Wielaard - 0.173-4 - Add elfutils-0.173-elfcompress.patch (#1607044)