mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-22 09:31:51 +00:00
[efi] Verify object format support in elf2efi.c
Currently, if you attempt to build 64-bit EFI binaries on a 32-bit system without a suitable cross-compiling version of libbfd, the iPXE build will die with a segmentation fault in elf2efi64. Fix by properly handling the return value from bfd_check_format(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
620b98ee4b
commit
ceba975b15
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user