xref: /openbmc/u-boot/arch/x86/lib/elf_ia32_efi.lds (revision afaea1f5)
1/* SPDX-License-Identifier: BSD-2-Clause */
2/*
3 * U-Boot EFI linker script
4 *
5 * Modified from usr/lib32/elf_ia32_efi.lds in gnu-efi
6 */
7
8OUTPUT_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)
49		*(.bss*)
50		*(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}
92