mirror of
https://github.com/ipxe/ipxe
synced 2025-12-30 04:28:12 +03:00
[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:
@@ -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) $< $@
|
||||
|
||||
Reference in New Issue
Block a user