Bug 1455620 - eu-strip generates empty output if there is nothing to do
Summary: eu-strip generates empty output if there is nothing to do
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: elfutils
Version: DTS 6.1 RHEL 6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: alpha
: 7.0
Assignee: Mark Wielaard
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-25 15:45 UTC by Paulo Andrade
Modified: 2017-10-24 09:46 UTC (History)
7 users (show)

Fixed In Version: devtoolset-7-elfutils-0.169-3.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-24 09:46:09 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:3010 normal SHIPPED_LIVE new packages: devtoolset-7-elfutils 2017-10-24 13:20:15 UTC
Sourceware 21522 None None None 2017-05-25 15:47:09 UTC

Description Paulo Andrade 2017-05-25 15:45:52 UTC
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.
"""

Comment 2 Mark Wielaard 2017-06-07 18:53:11 UTC
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.

Comment 4 Martin Cermak 2017-09-15 13:54:57 UTC
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.

Comment 6 errata-xmlrpc 2017-10-24 09:46:09 UTC
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


Note You need to log in before you can comment on or make changes to this bug.