summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util/elf2efi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c
index 7870bb901..1d73807e9 100644
--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -247,8 +247,9 @@ static bfd * open_input_bfd ( const char *filename ) {
/* The call to bfd_check_format() must be present, otherwise
* we get a segfault from later BFD calls.
*/
- if ( bfd_check_format ( bfd, bfd_object ) < 0 ) {
- eprintf ( "%s is not an object file\n", filename );
+ if ( ! bfd_check_format ( bfd, bfd_object ) ) {
+ eprintf ( "%s is not an object file: ", filename );
+ bfd_perror ( NULL );
exit ( 1 );
}