From 268ec6e00e57497b96ebd4a5a5dc60b821e13fb0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 31 Jan 2018 18:45:35 +0000 Subject: efi_loader: fix building crt0 on arm Before the patch an undefined constant EFI_SUBSYSTEM was used in the crt0 code. The current version of binutils does not swallow the error. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888403 The necessary constant IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in pe.h. So let's factor out asm-generic/pe.h for the image subsystem constants and use it in our assembler code. IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER does not exist in the specification let's use IMAGE_SUBSYSTEM_EFI_ROM instead. The include pe.h is only used in code maintained by Alex so let him be the maintainer here too. Reported-by: Andre Przywara Signed-off-by: Heinrich Schuchardt Tested-by: Vagrant Cascadian Signed-off-by: Alexander Graf --- arch/arm/lib/crt0_aarch64_efi.S | 4 +++- arch/arm/lib/crt0_arm_efi.S | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/arm/lib') diff --git a/arch/arm/lib/crt0_aarch64_efi.S b/arch/arm/lib/crt0_aarch64_efi.S index 5205646..9b0e894 100644 --- a/arch/arm/lib/crt0_aarch64_efi.S +++ b/arch/arm/lib/crt0_aarch64_efi.S @@ -8,6 +8,8 @@ * This file is taken and modified from the gnu-efi project. */ +#include + .section .text.head /* @@ -62,7 +64,7 @@ extra_header_fields: */ .long _start - ImageBase /* SizeOfHeaders */ .long 0 /* CheckSum */ - .short EFI_SUBSYSTEM /* Subsystem */ + .short IMAGE_SUBSYSTEM_EFI_APPLICATION /* Subsystem */ .short 0 /* DllCharacteristics */ .quad 0 /* SizeOfStackReserve */ .quad 0 /* SizeOfStackCommit */ diff --git a/arch/arm/lib/crt0_arm_efi.S b/arch/arm/lib/crt0_arm_efi.S index 967c885..af55bba 100644 --- a/arch/arm/lib/crt0_arm_efi.S +++ b/arch/arm/lib/crt0_arm_efi.S @@ -8,6 +8,8 @@ * This file is taken and modified from the gnu-efi project. */ +#include + .section .text.head /* @@ -64,7 +66,7 @@ extra_header_fields: */ .long _start - image_base /* SizeOfHeaders */ .long 0 /* CheckSum */ - .short EFI_SUBSYSTEM /* Subsystem */ + .short IMAGE_SUBSYSTEM_EFI_APPLICATION /* Subsystem */ .short 0 /* DllCharacteristics */ .long 0 /* SizeOfStackReserve */ .long 0 /* SizeOfStackCommit */ -- cgit v1.1