xref: /openbmc/u-boot/arch/x86/lib/elf_x86_64_efi.lds (revision 12308b12)
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * U-Boot EFI linker script
4 *
5 * Modified from usr/lib32/elf_x86_64_efi.lds in gnu-efi
6 */
7
8OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
9OUTPUT_ARCH(i386:x86-64)
10ENTRY(_start)
11SECTIONS
12{
13	image_base = .;
14	.hash : { *(.hash) }	/* this MUST come first, EFI expects it */
15	. = ALIGN(4096);
16	.eh_frame : {
17		*(.eh_frame)
18	}
19
20	. = ALIGN(4096);
21
22	.text : {
23		*(.text)
24		*(.text.*)
25		*(.gnu.linkonce.t.*)
26	}
27
28	. = ALIGN(4096);
29
30	.reloc : {
31		*(.reloc)
32	}
33
34	. = ALIGN(4096);
35
36	.data : {
37		*(.rodata*)
38		*(.got.plt)
39		*(.got)
40		*(.data*)
41		*(.sdata)
42		/* the EFI loader doesn't seem to like a .bss section, so we stick
43		 * it all into .data: */
44		*(.sbss)
45		*(.scommon)
46		*(.dynbss)
47		*(.bss)
48		*(COMMON)
49		*(.rel.local)
50
51		/* U-Boot lists and device tree */
52		. = ALIGN(8);
53		*(SORT(.u_boot_list*));
54		. = ALIGN(8);
55		*(.dtb*);
56	}
57
58	. = ALIGN(4096);
59	.dynamic : { *(.dynamic) }
60	. = ALIGN(4096);
61
62	.rela : {
63		*(.rela.data*)
64		*(.rela.got)
65		*(.rela.stab)
66	}
67
68	. = ALIGN(4096);
69	.dynsym : { *(.dynsym) }
70	. = ALIGN(4096);
71	.dynstr : { *(.dynstr) }
72	. = ALIGN(4096);
73	.ignored.reloc : {
74		*(.rela.reloc)
75		*(.eh_frame)
76		*(.note.GNU-stack)
77	}
78
79	.comment 0 : { *(.comment) }
80}
81