blob: 3e3da47d6a9d17bd7bd5d538b4cd66d3af82c0d9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: BSD-2-Clause */
Simon Glass61378fd2016-11-07 08:47:11 -07002/*
3 * U-Boot aarch64 EFI linker script
4 *
Simon Glass61378fd2016-11-07 08:47:11 -07005 * Modified from elf_aarch64_efi.lds in gnu-efi
6 */
7
8OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
9OUTPUT_ARCH(aarch64)
Heinrich Schuchardt4936ff92023-01-04 23:43:08 +010010
11PHDRS
12{
13 data PT_LOAD FLAGS(3); /* SHF_WRITE | SHF_ALLOC */
14}
15
Simon Glass61378fd2016-11-07 08:47:11 -070016ENTRY(_start)
17SECTIONS
18{
19 .text 0x0 : {
20 _text = .;
21 *(.text.head)
22 *(.text)
23 *(.text.*)
24 *(.gnu.linkonce.t.*)
25 *(.srodata)
26 *(.rodata*)
Heinrich Schuchardt7b298a52022-12-31 11:58:54 +010027 . = ALIGN(16);
28 *(.dynamic);
Heinrich Schuchardtf2634792022-01-14 21:40:15 +010029 . = ALIGN(512);
Simon Glass61378fd2016-11-07 08:47:11 -070030 }
31 _etext = .;
32 _text_size = . - _text;
Heinrich Schuchardt7b298a52022-12-31 11:58:54 +010033 . = ALIGN(4096);
Simon Glass61378fd2016-11-07 08:47:11 -070034 .data : {
35 _data = .;
36 *(.sdata)
37 *(.data)
38 *(.data1)
39 *(.data.*)
40 *(.got.plt)
41 *(.got)
42
43 /*
44 * The EFI loader doesn't seem to like a .bss section, so we
45 * stick it all into .data:
46 */
47 . = ALIGN(16);
48 _bss = .;
49 *(.sbss)
50 *(.scommon)
51 *(.dynbss)
52 *(.bss)
53 *(.bss.*)
54 *(COMMON)
Heinrich Schuchardtf2634792022-01-14 21:40:15 +010055 . = ALIGN(512);
Simon Glass61378fd2016-11-07 08:47:11 -070056 _bss_end = .;
57 _edata = .;
Heinrich Schuchardt4936ff92023-01-04 23:43:08 +010058 } :data
Heinrich Schuchardt7b298a52022-12-31 11:58:54 +010059 _data_size = _edata - _data;
Simon Glass61378fd2016-11-07 08:47:11 -070060 .rela.dyn : { *(.rela.dyn) }
61 .rela.plt : { *(.rela.plt) }
62 .rela.got : { *(.rela.got) }
63 .rela.data : { *(.rela.data) *(.rela.data*) }
Simon Glass61378fd2016-11-07 08:47:11 -070064
65 . = ALIGN(4096);
66 .dynsym : { *(.dynsym) }
67 . = ALIGN(4096);
68 .dynstr : { *(.dynstr) }
69 . = ALIGN(4096);
70 .note.gnu.build-id : { *(.note.gnu.build-id) }
71 /DISCARD/ : {
72 *(.rel.reloc)
73 *(.eh_frame)
74 *(.note.GNU-stack)
75 }
76 .comment 0 : { *(.comment) }
77}