blob: aad61e7f817c5481639de520e7f20588107f0c06 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: BSD-2-Clause */
Ben Stoltzab76a472015-08-04 12:33:46 -06002/*
3 * U-Boot EFI linker script
4 *
Ben Stoltzab76a472015-08-04 12:33:46 -06005 * Modified from usr/lib32/elf_ia32_efi.lds in gnu-efi
6 */
7
Ben Stoltzab76a472015-08-04 12:33:46 -06008OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
9OUTPUT_ARCH(i386)
10ENTRY(_start)
11SECTIONS
12{
13 image_base = .;
14 .hash : { *(.hash) } /* this MUST come first, EFI expects it */
15 . = ALIGN(4096);
16 .text :
17 {
18 *(.text)
19 *(.text.*)
20 *(.gnu.linkonce.t.*)
21 }
22 . = ALIGN(4096);
23 .sdata :
24 {
25 *(.got.plt)
26 *(.got)
27 *(.srodata)
28 *(.sdata)
29 *(.sbss)
30 *(.scommon)
31 }
32 . = ALIGN(4096);
33 .data :
34 {
35 *(.rodata*)
36 *(.data)
37 *(.data1)
38 *(.data.*)
39 *(.sdata)
40 *(.got.plt)
41 *(.got)
42 /*
43 * the EFI loader doesn't seem to like a .bss section, so we
44 * stick it all into .data:
45 */
46 *(.sbss)
47 *(.scommon)
48 *(.dynbss)
Alexander Graf61c76782018-08-20 14:17:41 +020049 *(.bss*)
Ben Stoltzab76a472015-08-04 12:33:46 -060050 *(COMMON)
51
52 /* U-Boot lists and device tree */
53 . = ALIGN(8);
54 *(SORT(.u_boot_list*));
55 . = ALIGN(8);
56 *(.dtb*);
57 }
58
59 . = ALIGN(4096);
60 .dynamic : { *(.dynamic) }
61 . = ALIGN(4096);
62 .rel :
63 {
64 *(.rel.data)
65 *(.rel.data.*)
66 *(.rel.got)
67 *(.rel.stab)
68 *(.data.rel.ro.local)
69 *(.data.rel.local)
70 *(.data.rel.ro)
71 *(.data.rel*)
72 *(.rel.u_boot_list*)
73 }
74 . = ALIGN(4096);
75 .reloc : /* This is the PECOFF .reloc section! */
76 {
77 *(.reloc)
78 }
79 . = ALIGN(4096);
80 .dynsym : { *(.dynsym) }
81 . = ALIGN(4096);
82 .dynstr : { *(.dynstr) }
83 . = ALIGN(4096);
84 /DISCARD/ :
85 {
86 *(.rel.reloc)
87 *(.eh_frame)
88 *(.note.GNU-stack)
89 }
90 .comment 0 : { *(.comment) }
91}