blob: 41440594aa61f2e96183f9e74a2f2bae5b35cbff [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: BSD-2-Clause */
Simon Glassfc03fb92016-11-07 08:47:10 -07002/*
3 * U-Boot ARM EFI linker script
4 *
Simon Glassfc03fb92016-11-07 08:47:10 -07005 * Modified from elf_arm_efi.lds in gnu-efi
6 */
7
8OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
9OUTPUT_ARCH(arm)
Heinrich Schuchardt7e9a00e2024-02-26 22:24:08 +010010
11PHDRS
12{
13 data PT_LOAD FLAGS(3); /* PF_W | PF_X */
14}
15
Simon Glassfc03fb92016-11-07 08:47:10 -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 Schuchardt7e9a00e2024-02-26 22:24:08 +010027 . = ALIGN(16);
28 *(.dynamic);
Heinrich Schuchardtf2634792022-01-14 21:40:15 +010029 . = ALIGN(512);
Simon Glassfc03fb92016-11-07 08:47:10 -070030 }
31 _etext = .;
32 _text_size = . - _text;
Heinrich Schuchardt7e9a00e2024-02-26 22:24:08 +010033 . = ALIGN(4096);
Simon Glassfc03fb92016-11-07 08:47:10 -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 Glassfc03fb92016-11-07 08:47:10 -070056 _bss_end = .;
57 _edata = .;
Heinrich Schuchardt7e9a00e2024-02-26 22:24:08 +010058 } :data
59 _data_size = . - _data;
Simon Glassfc03fb92016-11-07 08:47:10 -070060
Simon Glassfc03fb92016-11-07 08:47:10 -070061 /DISCARD/ : {
Heinrich Schuchardt7e9a00e2024-02-26 22:24:08 +010062 /*
63 * We don't support relocations. These would have to be
64 * translated from ELF to PE format and added to the .reloc
65 * section.
66 */
67 *(.rel.dyn)
68 *(.rel.plt)
69 *(.rel.got)
70 *(.rel.data)
71 *(.rel.data*)
Simon Glassfc03fb92016-11-07 08:47:10 -070072 *(.rel.reloc)
73 *(.eh_frame)
74 *(.note.GNU-stack)
Alexander Graf71acd4f2017-12-11 09:45:30 +010075 *(.dynsym)
76 *(.dynstr)
77 *(.note.gnu.build-id)
78 *(.comment)
Simon Glassfc03fb92016-11-07 08:47:10 -070079 }
Simon Glassfc03fb92016-11-07 08:47:10 -070080}