bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/3001] New: incorrect exit status from strip (and other err


From: c dot g dot demetriou at gmail dot com
Subject: [Bug binutils/3001] New: incorrect exit status from strip (and other errors introduced 2003-11-07)
Date: 5 Aug 2006 05:23:55 -0000

So, first I noticed:

address@hidden binutils]$ ./strip-new foobar
./strip-new: 'foobar': No such file
address@hidden binutils]$ echo $?
0

That didn't seem right.  8-)

I originally noticed this on RHEL4u3, but verified it exists in current head.

I then tracked this down to changes made on 2003-11-07, specifically objcopy.c 
rev 1.56 and the related changes.

To verify that previously it would have returned a non-zero exit status, I 
downloaded and tested binutils 2.14.  (keep reading 8-)

Going from there and a quick M-x grep get_file_size, I noticed the following 
exit status errors.  I've provided comparison results from binutils 2.14 for
reference:

 * ./strip-new nonex -> exit status 0.  (was 127)
 * ./objcopy --add-section foo=nonex -> exit status 0.  (was 1)
 * ./objcopy --keep-symbols nonex file.o file_new.o -> exit status 0 (was 1).
   (I suspect other symbol-file-related flags would have similar issues, i.e.,
    all callers of add_specific_symbols().)
 * ./addr2line nonex -> exit status 0 (was 1)
 * ./ranlib nonex -> exit status 0 (was 9)
 * ./ranlib -t nonex -> exit status 0 (was 1)
 * ./objdump -x nonex -> exit status 0 (was 1)
 * ./size nonex -> exit status 0 (was 1)

The following still exit with an error status:
 * ./nm nonex
 * ./objcopy nonex nonex2 -- but this reports that input file 'nonex' is
   empty... right after saying that there's no such file.


These issues seem to have been introduced in the commits on 2003-11-07 around 
12:19 UTC.  Specific revisions:
 * objcopy.c 1.56
 * addr2line.c 1.20

etc., i.e., the commits with the ChangeLog entry:

2003-11-07  Jonathan R. Grant  <address@hidden>

        * bucomm,c (get_file_size): New function.  Returns the size of a
          file.
        * bucomm.h: Add prototype for get_file_size.
        * addr2line.c (process_file): Use new function.
        * ar.c (main, ranlib_only, ranlib_touch): Likewise.
        * nm.c (display_file): Likewise.
        * objcopy.c (add_specific_symbols, copy_file, strip_main,
          copy_main): Likewise.
        * objdump.c (display_file): Likewise.
        * size.c (display_file): Likewise.
        * strings.c (strings_file): Likewise.
        * readelf.c (process_file): Use similar code to get_file_size.

(committed by nickc).


Sorry, I don't have patches.  (I've got other fish to fry at the moment, and I 
can't use a patched binutils in my project anyway.  I also don't have a valid 
assignment on file at this point, either.)

Hopefully I've at least provided enough info to make it easy for somebody else 
to resolve these issues quickly/easily...

-- 
           Summary: incorrect exit status from strip (and other errors
                    introduced 2003-11-07)
           Product: binutils
           Version: 2.18 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: c dot g dot demetriou at gmail dot com
                CC: bug-binutils at gnu dot org,c dot g dot demetriou at
                    gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=3001

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]