summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-01-24 16:00:49 +0100
committerMark Wielaard <mark@klomp.org>2019-01-24 16:06:29 +0100
commit4540ea98ce3314c84273f5c9cbb8b774f1463dc4 (patch)
treed6f0c5cbfae29944155a7b458e0765ed62a52530 /src
parenta17c2c0917901ffa542ac4d3e327d46742219e04 (diff)
strip: Fix check test for SHN_XINDEX symbol.
The check for whether a symbol used the extended section table was wrong causing the run-strip-test-many.sh testcase to declare the testfile was an illformed file. Fixing this exposed a strict elfutils check for the '.shstrtab' section having this exact name and a SHT_STRTAB type. This might be a little too strict, but easily worked around by changing the name of the "old" shstrtab section in the addsections program. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/strip.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0ea106c5..0544fceb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-24 Mark Wielaard <mark@klomp.org>
+
+ * strip.c (handle_elf): Fix check test for SHN_XINDEX symbol.
+
2019-01-22 Mark Wielaard <mark@klomp.org>
* readelf.c (print_debug_line_section): Check we are not at end of
diff --git a/src/strip.c b/src/strip.c
index 15180737..a73009d9 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -1944,7 +1944,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
INTERNAL_ERROR (fname);
if (sym->st_shndx == SHN_UNDEF
- || (sym->st_shndx >= shnum
+ || (sym->st_shndx >= SHN_LORESERVE
&& sym->st_shndx != SHN_XINDEX))
{
/* This is no section index, leave it alone