Commit 221faac5 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Peter Jones

Add support for 32-bit ARM

This adds support for building the shim for a 32-bit ARM UEFI environment.
Signed-off-by: 's avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
parent 9196c7cf
......@@ -15,6 +15,9 @@ endif
ifeq ($(ARCH),aarch64)
CFLAGS += -O2 -DSIXTY_FOUR_BIT_LONG -ffreestanding -I$(shell $(CC) -print-file-name=include)
endif
ifeq ($(ARCH),arm)
CFLAGS += -O2 -DTHIRTY_TWO_BIT -ffreestanding -I$(shell $(CC) -print-file-name=include)
endif
LDFLAGS = -nostdlib -znocombreloc
TARGET = libopenssl.a
......
......@@ -41,6 +41,10 @@ ifeq ($(ARCH),aarch64)
CFLAGS += -ffreestanding -I$(shell $(CC) -print-file-name=include)
endif
ifeq ($(ARCH),arm)
CFLAGS += -ffreestanding -I$(shell $(CC) -print-file-name=include)
endif
ifneq ($(origin VENDOR_CERT_FILE), undefined)
CFLAGS += -DVENDOR_CERT_FILE=\"$(VENDOR_CERT_FILE)\"
endif
......@@ -118,6 +122,12 @@ SUBSYSTEM := 0xa
LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
endif
ifeq ($(ARCH),arm)
FORMAT := -O binary
SUBSYSTEM := 0xa
LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
endif
FORMAT ?= --target efi-app-$(ARCH)
%.efi: %.so
......
.globl cert_table
.data
.align 16
.type cert_table, @object
.type cert_table, %object
.size cert_table, 4
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
cert_table:
#if defined(VENDOR_CERT_FILE)
.long vendor_cert_priv_end - vendor_cert_priv
......@@ -20,48 +18,48 @@ cert_table:
#if defined(VENDOR_CERT_FILE)
.data
.align 1
.type vendor_cert_priv, @object
.type vendor_cert_priv, %object
.size vendor_cert_priv, vendor_cert_priv_end-vendor_cert_priv
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
vendor_cert_priv:
.incbin VENDOR_CERT_FILE
vendor_cert_priv_end:
#else
.bss
.type vendor_cert_priv, @object
.type vendor_cert_priv, %object
.size vendor_cert_priv, 1
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
vendor_cert_priv:
.zero 1
.data
.align 4
.type vendor_cert_size_priv, @object
.type vendor_cert_size_priv, %object
.size vendor_cert_size_priv, 4
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
vendor_cert_priv_end:
#endif
#if defined(VENDOR_DBX_FILE)
.data
.align 1
.type vendor_dbx_priv, @object
.type vendor_dbx_priv, %object
.size vendor_dbx_priv, vendor_dbx_priv_end-vendor_dbx_priv
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
vendor_dbx_priv:
.incbin VENDOR_DBX_FILE
vendor_dbx_priv_end:
#else
.bss
.type vendor_dbx_priv, @object
.type vendor_dbx_priv, %object
.size vendor_dbx_priv, 1
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
vendor_dbx_priv:
.zero 1
.data
.align 4
.type vendor_dbx_size_priv, @object
.type vendor_dbx_size_priv, %object
.size vendor_dbx_size_priv, 4
.section .vendor_cert, "a", @progbits
.section .vendor_cert, "a", %progbits
vendor_dbx_priv_end:
#endif
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
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);
.rel.dyn : { *(.rel.dyn) }
.rel.plt : { *(.rel.plt) }
.rel.got : { *(.rel.got) }
.rel.data : { *(.rel.data) *(.rel.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) }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment