Reported to DTS 6.1, as it is the original user report, but happens in all eu-strip versions, all rhel releases and fedora. """ Steps to reproduce: $ cat test.c int main() { return 1; } $ gcc test.c $ eu-strip -g -o test ./a.out The "test" file will have zero bytes. This happens because of the test in src/strip.c: /* Test whether we are doing anything at all. */ if (cnt == idx) /* Nope, all removable sections are already gone. */ goto fail_close; Note also that, if the test is removed, it still generates a different binary, so, the test is incomplete, or should be removed. """
Posted an upstream fix: https://sourceware.org/ml/elfutils-devel/2017-q2/msg00237.html Please note the new testcase that checks the following assumptions of correct output when the -o and -f flags are used on binaries that have no (debug) sections removed: # If there is nothing to strip then -o output should be identical to input. # And there should not be an (empty) -f debug file.
Reproduced with elfutils-0.168-8.el7, verified against devtoolset-7-elfutils-0.170-1.el{6,7}. Included run-strip-nothing.sh passed as well.
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