from Fedora 26 to Fedora 27, the readelf exit status changed from 1 to 0 when running "readelf -d" on an empty file: old: > touch /tmp/foo > readelf -d /tmp/foo readelf: /tmp/foo: Error: Failed to read file's magic number > echo $? 1 > readelf --version GNU readelf version 2.27-28.fc26 Copyright (C) 2016 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. new: > touch /tmp/foo > readelf -d /tmp/foo readelf: /tmp/foo: Error: Failed to read file's magic number > echo $? 0 > readelf --version GNU readelf version 2.29-6.fc27 Copyright (C) 2017 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. but readelf still prints an error - so i think it should not exit with 0.
Hi Michael, This is a Fedora specific bug. The FSF binutils sources do the right thing. Please could you refile the bug report using the Fedora bugzilla system here: https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora Cheers Nick