diff options
| author | Mark Wielaard <[email protected]> | 2017-06-07 14:05:36 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2017-06-14 14:51:33 +0200 |
| commit | e0b3232e9a0bc8215ca1be29b1ec6df43811eb87 (patch) | |
| tree | 28fc9df73820d6e0475a5a5cc6cc34a84e6b64f7 /tests | |
| parent | 660aafcf78818424248faccf2ccab4ac9deee582 (diff) | |
strip: Make sure old .shstrab is removed when eu-strip recreates it.
Although we always recreate the .shstrtab section for the new output
file we never explicitly assumed it could be removed. It might not be
possible to remove it when the section string table is shared with
a symbol table. But if it is removable we should (and recreate it for
the new section list).
Regression introduced in commit elfutils-0.163-33-gdf7dfab.
"Handle merged strtab/shstrtab string tables in strip and unstrip."
Add extra testcase to explicitly check for this case.
https://sourceware.org/bugzilla/show_bug.cgi?id=21525
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ChangeLog | 4 | ||||
| -rwxr-xr-x | tests/run-strip-test.sh | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 43b5bd8a..a7b20224 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2017-06-06 Mark Wielaard <[email protected]> + + * run-strip-test.sh: Test strip -g doesn't introduce extra .shstrtab. + 2017-05-30 Mark Wielaard <[email protected]> * run-backtrace-fp-core-ppc64le.sh: New test. diff --git a/tests/run-strip-test.sh b/tests/run-strip-test.sh index 42aa9888..280814e6 100755 --- a/tests/run-strip-test.sh +++ b/tests/run-strip-test.sh @@ -49,6 +49,14 @@ testrun ${abs_top_builddir}/src/unstrip -o testfile.unstrip testfile.temp testfi testrun ${abs_top_builddir}/src/elfcmp --hash-inexact $original testfile.unstrip } +# test strip -g +testrun ${abs_top_builddir}/src/strip -g -o testfile.temp $original + +# Buggy eu-strip created multiple .shstrtab sections +shstrtab_SECS=$(testrun ${abs_top_builddir}/src/readelf -S testfile.temp | grep '.shstrtab' | wc --lines) +test $shstrtab_SECS -eq 1 || + { echo "*** failure not just one '.shstrtab' testfile.temp ($shstrtab_SECS)"; status=1; } + # Now strip in-place and make sure it is smaller. SIZE_original=$(stat -c%s $original) testrun ${abs_top_builddir}/src/strip $original |
