mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-06 02:52:25 +00:00
Add support for 64-bit ARM (AArch64)
This adds support for building the shim for a 64-bit ARM UEFI environment. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
parent
99d7b5e858
commit
04cba93d64
@ -12,6 +12,9 @@ ifeq ($(ARCH),ia32)
|
|||||||
CFLAGS += -mno-mmx -mno-sse -mno-red-zone -maccumulate-outgoing-args \
|
CFLAGS += -mno-mmx -mno-sse -mno-red-zone -maccumulate-outgoing-args \
|
||||||
-m32 -DTHIRTY_TWO_BIT
|
-m32 -DTHIRTY_TWO_BIT
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(ARCH),aarch64)
|
||||||
|
CFLAGS += -O2 -DSIXTY_FOUR_BIT_LONG -ffreestanding -I$(shell $(CC) -print-file-name=include)
|
||||||
|
endif
|
||||||
LDFLAGS = -nostdlib -znocombreloc
|
LDFLAGS = -nostdlib -znocombreloc
|
||||||
|
|
||||||
TARGET = libopenssl.a
|
TARGET = libopenssl.a
|
||||||
|
10
Makefile
10
Makefile
@ -37,6 +37,10 @@ ifeq ($(ARCH),ia32)
|
|||||||
CFLAGS += -mno-mmx -mno-sse -mno-red-zone -nostdinc -maccumulate-outgoing-args -m32
|
CFLAGS += -mno-mmx -mno-sse -mno-red-zone -nostdinc -maccumulate-outgoing-args -m32
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(ARCH),aarch64)
|
||||||
|
CFLAGS += -ffreestanding -I$(shell $(CC) -print-file-name=include)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(origin VENDOR_CERT_FILE), undefined)
|
ifneq ($(origin VENDOR_CERT_FILE), undefined)
|
||||||
CFLAGS += -DVENDOR_CERT_FILE=\"$(VENDOR_CERT_FILE)\"
|
CFLAGS += -DVENDOR_CERT_FILE=\"$(VENDOR_CERT_FILE)\"
|
||||||
endif
|
endif
|
||||||
@ -108,6 +112,12 @@ Cryptlib/OpenSSL/libopenssl.a:
|
|||||||
lib/lib.a:
|
lib/lib.a:
|
||||||
$(MAKE) -C lib
|
$(MAKE) -C lib
|
||||||
|
|
||||||
|
ifeq ($(ARCH),aarch64)
|
||||||
|
FORMAT := -O binary
|
||||||
|
SUBSYSTEM := 0xa
|
||||||
|
LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
|
||||||
|
endif
|
||||||
|
|
||||||
FORMAT ?= --target efi-app-$(ARCH)
|
FORMAT ?= --target efi-app-$(ARCH)
|
||||||
|
|
||||||
%.efi: %.so
|
%.efi: %.so
|
||||||
|
65
elf_aarch64_efi.lds
Normal file
65
elf_aarch64_efi.lds
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
|
||||||
|
OUTPUT_ARCH(aarch64)
|
||||||
|
ENTRY(_start)
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
.text 0x0 : {
|
||||||
|
*(.text.head)
|
||||||
|
*(.text)
|
||||||
|
*(.text.*)
|
||||||
|
*(.gnu.linkonce.t.*)
|
||||||
|
*(.srodata)
|
||||||
|
*(.rodata*)
|
||||||
|
. = ALIGN(16);
|
||||||
|
_etext = .;
|
||||||
|
}
|
||||||
|
.dynamic : { *(.dynamic) }
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
*(.sdata)
|
||||||
|
*(.data)
|
||||||
|
*(.data1)
|
||||||
|
*(.data.*)
|
||||||
|
*(.got.plt)
|
||||||
|
*(.got)
|
||||||
|
|
||||||
|
/* the EFI loader doesn't seem to like a .bss section, so we stick
|
||||||
|
it all into .data: */
|
||||||
|
. = ALIGN(16);
|
||||||
|
_bss = .;
|
||||||
|
*(.sbss)
|
||||||
|
*(.scommon)
|
||||||
|
*(.dynbss)
|
||||||
|
*(.bss)
|
||||||
|
*(COMMON)
|
||||||
|
. = ALIGN(16);
|
||||||
|
_bss_end = .;
|
||||||
|
}
|
||||||
|
|
||||||
|
. = ALIGN(4096);
|
||||||
|
.vendor_cert :
|
||||||
|
{
|
||||||
|
*(.vendor_cert)
|
||||||
|
}
|
||||||
|
. = ALIGN(4096);
|
||||||
|
|
||||||
|
.rela.dyn : { *(.rela.dyn) }
|
||||||
|
.rela.plt : { *(.rela.plt) }
|
||||||
|
.rela.got : { *(.rela.got) }
|
||||||
|
.rela.data : { *(.rela.data) *(.rela.data*) }
|
||||||
|
_edata = .;
|
||||||
|
_data_size = . - _etext;
|
||||||
|
|
||||||
|
. = ALIGN(4096);
|
||||||
|
.dynsym : { *(.dynsym) }
|
||||||
|
. = ALIGN(4096);
|
||||||
|
.dynstr : { *(.dynstr) }
|
||||||
|
. = ALIGN(4096);
|
||||||
|
/DISCARD/ :
|
||||||
|
{
|
||||||
|
*(.rel.reloc)
|
||||||
|
*(.eh_frame)
|
||||||
|
*(.note.GNU-stack)
|
||||||
|
}
|
||||||
|
.comment 0 : { *(.comment) }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user