Hide Forgot
Description of problem: readelf exit status is 0 for empty zero-length file Version-Release number of selected component (if applicable): binutils-2.29-6.fc27.x86_64 How reproducible: always Steps to Reproduce: 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, Thanks for reporting this bug. The problem was an error in a Fedora local patch that "improves" readelf so that it reports the filename in error messages. (Which only really makes a difference when readelf is run on multiple files at the same time). I have checked in a patch to fix the problem, so please try the new binutils-2.29-8.fc27 rpm. (Once it finished building...) Cheers Nick
okay, installed rpm from koji, my script runs without spurious errors now. https://koji.fedoraproject.org/koji/buildinfo?buildID=1007764
binutils-2.29-13.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1e994c659e
binutils-2.29-13.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-1e994c659e
binutils-2.29-13.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.