This issue happens in all Red Hat releases and Fedora, but reported here, as the issue was reported for DTS 6.1 on RHEL 6. """ I understand this is not really a bug, but it generates an output more complex than it should be, and confuses tools like patchelf. Example: $ cat test.c int main() { return 1; } $ gcc -g test.c $ eu-strip -g a.out $ eu-readelf -S a.out | grep .shstrtab | wc -l The extra section appears useless at least on the sense of a very simple test case. The issue started with this commit: https://sourceware.org/git/?p=elfutils.git;a=commit;h=df7dfab451246e8b088040e052ca01f9d6aba774 """ patchelf is not a Red Hat package.
Replicated. There are indeed two .shstrtab sections. Only the second is used (and it is what ELF section header string table points at). The first is the old unused copy from the original file with the old section names in it. This is indeed unfortunate for tools selecting sections by name. It isn't guaranteed that two sections cannot have the same name. But tools might still make that assumption.
Posted an upstream fix: https://sourceware.org/ml/elfutils-devel/2017-q2/msg00235.html
Replicated using elfutils-0.168-8.el7, verified using devtoolset-7-elfutils-0.170-1.el{6,7} both using the initial reproducer and using provided/packaged run-strip-test.sh.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2017:3010