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