mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 10:02:42 +03:00
The linker chooses to look for _start first and always picks efidrvprefix.o to satisfy it (probably because it's earlier in the archive) which causes a multiple definition error when the linker later has to pick efiprefix.o for other symbols. Fix by using EFI-specific TGT_LD_FLAGS with an explicit entry point. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
33 lines
714 B
Makefile
33 lines
714 B
Makefile
# -*- makefile -*- : Force emacs to use Makefile mode
|
|
|
|
# The EFI linker script
|
|
#
|
|
LDSCRIPT = arch/x86/scripts/efi.lds
|
|
|
|
# Retain relocation information for elf2efi
|
|
#
|
|
LDFLAGS += -q -S
|
|
|
|
# Media types.
|
|
#
|
|
NON_AUTO_MEDIA += efi
|
|
NON_AUTO_MEDIA += efidrv
|
|
|
|
# Specify entry point
|
|
#
|
|
TGT_LD_FLAGS_PRE = -e _$(TGT_PREFIX)_start
|
|
|
|
# Rules for building EFI files
|
|
#
|
|
$(BIN)/%.efi : $(BIN)/%.efi.tmp $(ELF2EFI)
|
|
$(QM)$(ECHO) " [FINISH] $@"
|
|
$(Q)$(ELF2EFI) --subsystem=10 $< $@
|
|
|
|
$(BIN)/%.efidrv : $(BIN)/%.efidrv.tmp $(ELF2EFI)
|
|
$(QM)$(ECHO) " [FINISH] $@"
|
|
$(Q)$(ELF2EFI) --subsystem=11 $< $@
|
|
|
|
$(BIN)/%.efirom : $(BIN)/%.efidrv $(EFIROM)
|
|
$(QM)$(ECHO) " [FINISH] $@"
|
|
$(Q)$(EFIROM) -v $(TGT_PCI_VENDOR) -d $(TGT_PCI_DEVICE) $< $@
|