From 6487c2241f75476830c2a0ac9d7043d5c02f083d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 5 Jul 2019 14:29:50 +0200 Subject: [PATCH] 0.176-4 - Add elfutils-0.176-strip-symbols-illformed.patch --- elfutils-0.176-strip-symbols-illformed.patch | 26 ++++++++++++++++++++ elfutils.spec | 5 ++++ 2 files changed, 31 insertions(+) create mode 100644 elfutils-0.176-strip-symbols-illformed.patch diff --git a/elfutils-0.176-strip-symbols-illformed.patch b/elfutils-0.176-strip-symbols-illformed.patch new file mode 100644 index 0000000..a0f22c8 --- /dev/null +++ b/elfutils-0.176-strip-symbols-illformed.patch @@ -0,0 +1,26 @@ +commit f03ac75239e0981deaf4aa18f66f423bcc5ce051 +Author: Mark Wielaard +Date: Wed Mar 27 21:54:06 2019 +0100 + + strip: Files with symbols referring to non-existing sections are illformed + + The check added in commit 4540ea98c "strip: Fix check test for SHN_XINDEX + symbol" was not complete. The (extended) section index should also exist. + If it doesn't exist, mark the file as illformed. + + https://sourceware.org/bugzilla/show_bug.cgi?id=24385 + + Signed-off-by: Mark Wielaard + +diff --git a/src/strip.c b/src/strip.c +index a73009d9..4cd87506 100644 +--- a/src/strip.c ++++ b/src/strip.c +@@ -1975,6 +1975,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, + && shndxdata->d_buf != NULL); + size_t sidx = (sym->st_shndx != SHN_XINDEX + ? sym->st_shndx : xshndx); ++ elf_assert (sidx < shnum); + sec = shdr_info[sidx].idx; + + if (sec != 0) diff --git a/elfutils.spec b/elfutils.spec index b57d0f0..27d050d 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -23,6 +23,7 @@ Patch1: elfutils-0.176-gcc-pr88835.patch Patch2: elfutils-0.176-pt-gnu-prop.patch Patch3: elfutils-0.176-xlate-note.patch Patch4: elfutils-0.176-elf-update.patch +Patch5: elfutils-0.176-strip-symbols-illformed.patch Requires: elfutils-libelf%{depsuffix} = %{version}-%{release} Requires: elfutils-libs%{depsuffix} = %{version}-%{release} @@ -188,6 +189,7 @@ profiling) of processes. %patch2 -p1 -b .pt-gnu-prop %patch3 -p1 -b .xlate-note %patch4 -p1 -b .elf-update +%patch5 -p1 -b .strip-illformed # In case the above patches added any new test scripts, make sure they # are executable. @@ -321,6 +323,9 @@ fi %endif %changelog +* Fri Jul 5 2019 Mark Wielaard - 0.176-4 +- Add elfutils-0.176-strip-symbols-illformed.patch + * Mon Jun 3 2019 Mark Wielaard - 0.176-3 - Add elfutils-0.176-elf-update.patch