[efi] Use elf2efi utility in place of efilink

elf2efi converts a suitable ELF executable (containing relocation
information, and with appropriate virtual addresses) into an EFI
executable.  It is less tightly coupled with the gPXE build process
and, in particular, does not require the use of a hand-crafted PE
image header in efiprefix.S.

elf2efi correctly handles .bss sections, which significantly reduces
the size of the gPXE EFI executable.
This commit is contained in:
Michael Brown
2009-01-07 02:05:51 +00:00
parent 85e5e25c52
commit 314779eb36
16 changed files with 939 additions and 1258 deletions

View File

@@ -2,11 +2,11 @@
# The EFI linker script
#
LDSCRIPT = arch/i386/scripts/efi.lds
LDSCRIPT = arch/x86/scripts/efi.lds
# Use a relocatable link; we perform final relocations in the efilink utility.
# Retain relocation information for elf2efi
#
LDFLAGS += -r -d -S
LDFLAGS += -q -S
# Media types.
#
@@ -14,12 +14,6 @@ NON_AUTO_MEDIA += efi
# Rule for building EFI files
#
$(BIN)/%.efi.tmp-reloc : $(BIN)/%.efi.tmp $(EFILINK)
$(QM)$(ECHO) " [EFILINK] $@"
$(Q)# Check for unresolved symbols
$(Q)$(LD) -e 0 --no-warn-mismatch -o /dev/null $<
$(Q)$(EFILINK) $< $@
$(BIN)/%.efi : $(BIN)/%.efi.tmp-reloc
$(BIN)/%.efi : $(BIN)/%.efi.tmp $(ELF2EFI32)
$(QM)$(ECHO) " [FINISH] $@"
$(Q)$(OBJCOPY) -Obinary $< $@
$(Q)$(ELF2EFI32) $< $@