Skip to content

Commit 66ece1f

Browse files
committed
Modernize aarch64
Now that we've got "objcopy --target efi-app-aarch64" and similar, we don't have to go through heroic effort to try to make aarch64 builds work. This patch updates to a gnu-efi branch that has newer aarch64 crt0 code, and makes efi_aarch64_efi.lds be nearly identical to efi_x86_64_efi.lds. Signed-off-by: Peter Jones <[email protected]>
1 parent 5c44aaf commit 66ece1f

File tree

4 files changed

+58
-75
lines changed

4 files changed

+58
-75
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "gnu-efi"]
22
path = gnu-efi
33
url = https://github.com/rhboot/gnu-efi.git
4-
branch = shim-15.5
4+
branch = shim-15.6

Make.defaults

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ ifeq ($(ARCH),aarch64)
8484
ARCH_GNUEFI ?= aarch64
8585
ARCH_SUFFIX ?= aa64
8686
ARCH_SUFFIX_UPPER ?= AA64
87-
FORMAT := -O binary
88-
SUBSYSTEM := 0xa
89-
ARCH_LDFLAGS += --defsym=EFI_SUBSYSTEM=$(SUBSYSTEM)
87+
ARCH_LDFLAGS ?=
9088
ARCH_CFLAGS ?=
9189
endif
9290
ifeq ($(ARCH),arm)

elf_aarch64_efi.lds

Lines changed: 55 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,109 +3,94 @@ OUTPUT_ARCH(aarch64)
33
ENTRY(_start)
44
SECTIONS
55
{
6-
.text 0x0 : {
7-
_text = .;
8-
*(.text.head)
9-
*(.text)
10-
*(.text.*)
11-
*(.gnu.linkonce.t.*)
12-
_evtext = .;
13-
. = ALIGN(4096);
6+
. = 0;
7+
ImageBase = .;
8+
.hash : { *(.hash) } /* this MUST come first! */
9+
. = ALIGN(4096);
10+
.eh_frame :
11+
{
12+
*(.eh_frame)
13+
}
14+
. = ALIGN(4096);
15+
.text :
16+
{
17+
_text = .;
18+
*(.text)
19+
*(.text.*)
20+
*(.gnu.linkonce.t.*)
21+
_etext = .;
22+
}
23+
. = ALIGN(4096);
24+
.reloc :
25+
{
26+
*(.reloc)
27+
}
28+
. = ALIGN(4096);
29+
.note.gnu.build-id : {
30+
*(.note.gnu.build-id)
31+
}
32+
33+
. = ALIGN(4096);
34+
.data.ident : {
35+
*(.data.ident)
1436
}
15-
_etext = .;
16-
_text_size = . - _text;
17-
_text_vsize = _evtext - _text;
1837

1938
. = ALIGN(4096);
2039
.data :
2140
{
2241
_data = .;
23-
*(.sdata)
24-
*(.data)
25-
*(.data1)
26-
*(.data.*)
42+
*(.rodata*)
2743
*(.got.plt)
2844
*(.got)
29-
30-
*(.dynamic)
31-
45+
*(.data*)
46+
*(.sdata)
3247
/* the EFI loader doesn't seem to like a .bss section, so we stick
3348
it all into .data: */
34-
. = ALIGN(16);
35-
_bss = .;
3649
*(.sbss)
3750
*(.scommon)
3851
*(.dynbss)
3952
*(.bss)
4053
*(COMMON)
41-
_evdata = .;
42-
. = ALIGN(4096);
43-
_bss_end = .;
54+
*(.rel.local)
4455
}
45-
_edata = .;
46-
_data_vsize = _evdata - _data;
47-
_data_size = . - _data;
4856

49-
/*
50-
* Note that _sbat must be the beginning of the data, and _esbat must be the
51-
* end and must be before any section padding. The sbat self-check uses
52-
* _esbat to find the bounds of the data, and if the padding is included, the
53-
* CSV parser (correctly) rejects the data as having NUL values in one of the
54-
* required columns.
55-
*/
5657
. = ALIGN(4096);
57-
.sbat :
58+
.vendor_cert :
5859
{
59-
_sbat = .;
60-
*(.sbat)
61-
*(.sbat.*)
62-
_esbat = .;
63-
. = ALIGN(4096);
64-
_epsbat = .;
60+
*(.vendor_cert)
6561
}
66-
_sbat_size = _epsbat - _sbat;
67-
_sbat_vsize = _esbat - _sbat;
68-
6962
. = ALIGN(4096);
70-
.rodata :
71-
{
72-
_rodata = .;
73-
*(.rodata*)
74-
*(.srodata)
75-
. = ALIGN(16);
76-
*(.note.gnu.build-id)
77-
. = ALIGN(4096);
78-
*(.vendor_cert)
79-
*(.data.ident)
80-
. = ALIGN(4096);
81-
}
63+
.dynamic : { *(.dynamic) }
8264
. = ALIGN(4096);
8365
.rela :
8466
{
85-
*(.rela.dyn)
86-
*(.rela.plt)
87-
*(.rela.got)
88-
*(.rela.data)
8967
*(.rela.data*)
68+
*(.rela.got*)
69+
*(.rela.stab*)
9070
}
71+
_edata = .;
72+
_data_size = . - _data;
9173
. = ALIGN(4096);
92-
.dyn :
74+
.sbat :
9375
{
94-
*(.dynsym)
95-
*(.dynstr)
96-
_evrodata = .;
97-
. = ALIGN(4096);
76+
_sbat = .;
77+
*(.sbat)
78+
*(.sbat.*)
9879
}
99-
_erodata = .;
100-
_rodata_size = . - _rodata;
101-
_rodata_vsize = _evrodata - _rodata;
102-
_alldata_size = . - _data;
80+
_esbat = .;
81+
_sbat_size = . - _sbat;
10382

104-
/DISCARD/ :
83+
. = ALIGN(4096);
84+
.dynsym : { *(.dynsym) }
85+
. = ALIGN(4096);
86+
.dynstr : { *(.dynstr) }
87+
. = ALIGN(4096);
88+
.ignored.reloc :
10589
{
106-
*(.rel.reloc)
90+
*(.rela.reloc)
10791
*(.eh_frame)
10892
*(.note.GNU-stack)
10993
}
11094
.comment 0 : { *(.comment) }
95+
.note.gnu.build-id : { *(.note.gnu.build-id) }
11196
}

0 commit comments

Comments
 (0)