Skip to content

Commit

Permalink
[efi] Eliminate use of libbfd
Browse files Browse the repository at this point in the history
Parse the intermediate ELF file directly instead of using libbfd, in
order to allow for cross-compiled ELF objects.

As a side bonus, this eliminates libbfd as a build requirement.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed May 2, 2016
1 parent 71560d1 commit efd5cf9
Show file tree
Hide file tree
Showing 3 changed files with 298 additions and 177 deletions.
2 changes: 0 additions & 2 deletions src/Makefile
Expand Up @@ -53,8 +53,6 @@ EINFO := ./util/einfo
GENKEYMAP := ./util/genkeymap.pl
DOXYGEN := doxygen
LCAB := lcab
BINUTILS_DIR := /usr
BFD_DIR := $(BINUTILS_DIR)
ZLIB_DIR := /usr

###############################################################################
Expand Down
10 changes: 4 additions & 6 deletions src/Makefile.housekeeping
Expand Up @@ -1303,20 +1303,18 @@ CLEANUP += $(ZBIN)
#
# The EFI image converter
#
ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
-I$(ZLIB_DIR)/include -idirafter include
ELF2EFI_LDFLAGS := -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib -L$(ZLIB_DIR)/lib \
-lbfd -ldl -lz -Wl,--no-warn-search-mismatch
ELF2EFI_CFLAGS := -I$(ZLIB_DIR)/include -idirafter include
ELF2EFI_LDFLAGS := -L$(ZLIB_DIR)/lib -lz -Wl,--no-warn-search-mismatch

$(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
$(Q)$(HOST_CC) $(HOST_CFLAGS) $(ELF2EFI_CFLAGS) -DEFI_TARGET_IA32 $< \
$(Q)$(HOST_CC) $(HOST_CFLAGS) $(ELF2EFI_CFLAGS) -DEFI_TARGET32 $< \
$(ELF2EFI_LDFLAGS) -o $@
CLEANUP += $(ELF2EFI32)

$(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
$(Q)$(HOST_CC) $(HOST_CFLAGS) $(ELF2EFI_CFLAGS) -DEFI_TARGET_X64 $< \
$(Q)$(HOST_CC) $(HOST_CFLAGS) $(ELF2EFI_CFLAGS) -DEFI_TARGET64 $< \
$(ELF2EFI_LDFLAGS) -o $@
CLEANUP += $(ELF2EFI64)

Expand Down

0 comments on commit efd5cf9

Please sign in to comment.