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