blob: 5dd98091698c0491ad37035d31768b6ff7deb505 [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 }
Heinrich Schuchardtcc7ac842023-01-08 19:00:47 +010031 .rela.dyn : { *(.rela.dyn) }
32 .rela.plt : { *(.rela.plt) }
33 .rela.got : { *(.rela.got) }
34 .rela.data : { *(.rela.data) *(.rela.data*) }
Simon Glass61378fd2016-11-07 08:47:11 -070035 _etext = .;
36 _text_size = . - _text;
Heinrich Schuchardt7b298a52022-12-31 11:58:54 +010037 . = ALIGN(4096);
Simon Glass61378fd2016-11-07 08:47:11 -070038 .data : {
39 _data = .;
40 *(.sdata)
41 *(.data)
42 *(.data1)
43 *(.data.*)
44 *(.got.plt)
45 *(.got)
46
47 /*
48 * The EFI loader doesn't seem to like a .bss section, so we
49 * stick it all into .data:
50 */
51 . = ALIGN(16);
52 _bss = .;
53 *(.sbss)
54 *(.scommon)
55 *(.dynbss)
56 *(.bss)
57 *(.bss.*)
58 *(COMMON)
Heinrich Schuchardtf2634792022-01-14 21:40:15 +010059 . = ALIGN(512);
Simon Glass61378fd2016-11-07 08:47:11 -070060 _bss_end = .;
61 _edata = .;
Heinrich Schuchardt4936ff92023-01-04 23:43:08 +010062 } :data
Heinrich Schuchardt7b298a52022-12-31 11:58:54 +010063 _data_size = _edata - _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}