aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-11-07 08:05:17 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-11-12 23:13:54 +0100
commit3b4847cbee7cf5c2a6ea19c25003876d0cba4ced (patch)
tree9a3ce2aad6d03b5bb61018611e9d8314f70f036f /arch/sandbox/lib
parent7264e21fdead677687934eecda6ac98f37851acf (diff)
downloadu-boot-3b4847cbee7cf5c2a6ea19c25003876d0cba4ced.zip
u-boot-3b4847cbee7cf5c2a6ea19c25003876d0cba4ced.tar.gz
u-boot-3b4847cbee7cf5c2a6ea19c25003876d0cba4ced.tar.bz2
efi_loader: support building UEFI binaries on sandbox
On the sandbox the UEFI binaries must match the host architectures. Adjust the Makefiles. Provide the PE/COFF header and relocation files. Allow building helloworld.efi on the sandbox. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'arch/sandbox/lib')
-rw-r--r--arch/sandbox/lib/crt0_sandbox_efi.S32
-rw-r--r--arch/sandbox/lib/reloc_sandbox_efi.c32
2 files changed, 64 insertions, 0 deletions
diff --git a/arch/sandbox/lib/crt0_sandbox_efi.S b/arch/sandbox/lib/crt0_sandbox_efi.S
new file mode 100644
index 0000000..b15766c
--- /dev/null
+++ b/arch/sandbox/lib/crt0_sandbox_efi.S
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * PE/COFF header for EFI applications
+ *
+ * Copyright (c) 2019 Heinrich Schuchardt
+ */
+
+#include <host_arch.h>
+
+#if HOST_ARCH == HOST_ARCH_X86_64
+#include "../../../arch/x86/lib/crt0_x86_64_efi.S"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_X86
+#include "../../../arch/x86/lib/crt0_ia32_efi.S"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_AARCH64
+#include "../../../arch/arm/lib/crt0_aarch64_efi.S"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_ARM
+#include "../../../arch/arm/lib/crt0_arm_efi.S"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV32
+#include "../../../arch/riscv/lib/crt0_riscv_efi.S"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV64
+#include "../../../arch/riscv/lib/crt0_riscv_efi.S"
+#endif
diff --git a/arch/sandbox/lib/reloc_sandbox_efi.c b/arch/sandbox/lib/reloc_sandbox_efi.c
new file mode 100644
index 0000000..a21e675
--- /dev/null
+++ b/arch/sandbox/lib/reloc_sandbox_efi.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * position independent shared object relocator
+ *
+ * Copyright (c) 2019 Heinrich Schuchardt
+ */
+
+#include <host_arch.h>
+
+#if HOST_ARCH == HOST_ARCH_X86_64
+#include "../../../arch/x86/lib/reloc_x86_64_efi.c"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_X86
+#include "../../../arch/x86/lib/reloc_ia32_efi.c"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_AARCH64
+#include "../../../arch/arm/lib/reloc_aarch64_efi.c"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_ARM
+#include "../../../arch/arm/lib/reloc_arm_efi.c"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV32
+#include "../../../arch/riscv/lib/reloc_riscv_efi.c"
+#endif
+
+#if HOST_ARCH == HOST_ARCH_RISCV64
+#include "../../../arch/riscv/lib/reloc_riscv_efi.c"
+#endif