diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 81396724..fbb274ff 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -612,7 +612,8 @@ TGT_LD_IDS = pci_vendor_id=$(firstword $(TGT_PCI_VENDOR) 0) \ # TGT_LD_FLAGS = $(foreach SYM,$(TGT_LD_PREFIX) $(TGT_LD_DRIVERS) obj_config,\ -u $(SYM) --defsym check_$(SYM)=$(SYM) ) \ - $(patsubst %,--defsym %,$(TGT_LD_IDS)) + $(patsubst %,--defsym %,$(TGT_LD_IDS)) \ + $(TGT_LD_FLAGS_PRE) # Calculate list of debugging versions of objects to be included in # the target. diff --git a/src/arch/x86/Makefile.efi b/src/arch/x86/Makefile.efi index bef8d59d..4f0c1b24 100644 --- a/src/arch/x86/Makefile.efi +++ b/src/arch/x86/Makefile.efi @@ -13,6 +13,10 @@ LDFLAGS += -q -S 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) diff --git a/src/arch/x86/prefix/efidrvprefix.c b/src/arch/x86/prefix/efidrvprefix.c index 1de08a37..2215104b 100644 --- a/src/arch/x86/prefix/efidrvprefix.c +++ b/src/arch/x86/prefix/efidrvprefix.c @@ -29,8 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); * @v systab System table * @ret efirc EFI return status code */ -EFI_STATUS EFIAPI _start ( EFI_HANDLE image_handle, - EFI_SYSTEM_TABLE *systab ) { +EFI_STATUS EFIAPI _efidrv_start ( EFI_HANDLE image_handle, + EFI_SYSTEM_TABLE *systab ) { EFI_STATUS efirc; /* Initialise EFI environment */ diff --git a/src/arch/x86/prefix/efiprefix.c b/src/arch/x86/prefix/efiprefix.c index 61a9fc64..1515c6fc 100644 --- a/src/arch/x86/prefix/efiprefix.c +++ b/src/arch/x86/prefix/efiprefix.c @@ -28,8 +28,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); * @v systab System table * @ret efirc EFI return status code */ -EFI_STATUS EFIAPI _start ( EFI_HANDLE image_handle, - EFI_SYSTEM_TABLE *systab ) { +EFI_STATUS EFIAPI _efi_start ( EFI_HANDLE image_handle, + EFI_SYSTEM_TABLE *systab ) { EFI_STATUS efirc; /* Initialise EFI environment */ diff --git a/src/arch/x86/scripts/efi.lds b/src/arch/x86/scripts/efi.lds index 7525b81b..4368f732 100644 --- a/src/arch/x86/scripts/efi.lds +++ b/src/arch/x86/scripts/efi.lds @@ -5,8 +5,6 @@ * */ -ENTRY ( _start ) - SECTIONS { /* The file starts at a virtual address of zero, and sections are