diff mbox

[U-Boot,v4,13/14] efi: x86: Adjust EFI files support efi_loader

Message ID 1478533636-17577-14-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Alexander Graf
Headers show

Commit Message

Simon Glass Nov. 7, 2016, 3:47 p.m. UTC
Add compiler flags and make a few minor adjustments to support the efi
loader.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v4:
- Add new patch to adjust EFI files support efi_loader

Changes in v3: None
Changes in v2: None

 arch/x86/config.mk              | 16 ++++++++++++++++
 arch/x86/lib/Makefile           |  5 +++++
 arch/x86/lib/elf_ia32_efi.lds   |  2 --
 arch/x86/lib/elf_x86_64_efi.lds |  2 --
 4 files changed, 21 insertions(+), 4 deletions(-)

Comments

Alexander Graf Nov. 14, 2016, 11:06 p.m. UTC | #1
> Add compiler flags and make a few minor adjustments to support the efi
> loader.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Thanks, applied to efi-next

Alex
diff mbox

Patch

diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 12a8d73..03c71f7 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -65,3 +65,19 @@  PLATFORM_LDFLAGS += --emit-relocs
 LDFLAGS_FINAL += --gc-sections -pie
 
 endif
+
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+
+ifneq ($(CONFIG_EFI_STUB_64BIT),)
+EFI_LDS := elf_x86_64_efi.lds
+EFI_CRT0 := crt0_x86_64_efi.o
+EFI_RELOC := reloc_x86_64_efi.o
+EFI_TARGET := --target=efi-app-ia32
+else
+EFI_LDS := elf_ia32_efi.lds
+EFI_CRT0 := crt0_ia32_efi.o
+EFI_RELOC := reloc_ia32_efi.o
+EFI_TARGET := --target=efi-app-x86_64
+endif
+
+endif
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index aad6555..ff402dc 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -61,4 +61,9 @@  AFLAGS_crt0_x86_64_efi.o += -fpic -fshort-wchar
 
 extra-$(CONFIG_EFI_STUB_32BIT) += crt0_ia32_efi.o reloc_ia32_efi.o
 extra-$(CONFIG_EFI_STUB_64BIT) += crt0_x86_64_efi.o reloc_x86_64_efi.o
+
+endif
+
+ifneq ($(CONFIG_EFI_STUB)$(CONFIG_CMD_BOOTEFI_HELLO),)
+extra-y += $(EFI_CRT0) $(EFI_RELOC)
 endif
diff --git a/arch/x86/lib/elf_ia32_efi.lds b/arch/x86/lib/elf_ia32_efi.lds
index cd3b0a9..174d36f 100644
--- a/arch/x86/lib/elf_ia32_efi.lds
+++ b/arch/x86/lib/elf_ia32_efi.lds
@@ -6,8 +6,6 @@ 
  * Modified from usr/lib32/elf_ia32_efi.lds in gnu-efi
  */
 
-#include <config.h>
-
 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
 OUTPUT_ARCH(i386)
 ENTRY(_start)
diff --git a/arch/x86/lib/elf_x86_64_efi.lds b/arch/x86/lib/elf_x86_64_efi.lds
index 9d9f057..70c7c52 100644
--- a/arch/x86/lib/elf_x86_64_efi.lds
+++ b/arch/x86/lib/elf_x86_64_efi.lds
@@ -6,8 +6,6 @@ 
  * Modified from usr/lib32/elf_x86_64_efi.lds in gnu-efi
  */
 
-#include <config.h>
-
 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
 OUTPUT_ARCH(i386:x86-64)
 ENTRY(_start)