xref: /openbmc/u-boot/arch/x86/cpu/u-boot.lds (revision c9af6673)
1/*
2 * (C) Copyright 2002
3 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
4 *
5 * SPDX-License-Identifier:	GPL-2.0+
6 */
7
8#include <config.h>
9OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
10OUTPUT_ARCH(i386)
11ENTRY(_start)
12
13SECTIONS
14{
15#ifndef CONFIG_CMDLINE
16	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
17#endif
18
19	. = CONFIG_SYS_TEXT_BASE;	/* Location of bootcode in flash */
20	__text_start = .;
21	.text  : { *(.text*); }
22
23	. = ALIGN(4);
24
25	. = ALIGN(4);
26	.u_boot_list : {
27		KEEP(*(SORT(.u_boot_list*)));
28	}
29
30	. = ALIGN(4);
31	.rodata : {
32		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
33		KEEP(*(.rodata.efi.init));
34	}
35
36	. = ALIGN(4);
37	.data : { *(.data*) }
38
39	. = ALIGN(4);
40	.hash : { *(.hash*) }
41
42	. = ALIGN(4);
43	.got : { *(.got*) }
44
45	. = ALIGN(4);
46
47	.__efi_runtime_start : {
48		*(.__efi_runtime_start)
49	}
50
51	.efi_runtime : {
52		*(efi_runtime_text)
53		*(efi_runtime_data)
54	}
55
56	.__efi_runtime_stop : {
57		*(.__efi_runtime_stop)
58	}
59
60	.efi_runtime_rel_start :
61	{
62		*(.__efi_runtime_rel_start)
63	}
64
65	.efi_runtime_rel : {
66		*(.relefi_runtime_text)
67		*(.relefi_runtime_data)
68	}
69
70	.efi_runtime_rel_stop :
71	{
72		*(.__efi_runtime_rel_stop)
73	}
74
75	. = ALIGN(4);
76
77	__data_end = .;
78	__init_end = .;
79
80	. = ALIGN(4);
81	.dynsym : { *(.dynsym*) }
82
83	. = ALIGN(4);
84	__rel_dyn_start = .;
85	.rel.dyn : {
86		*(.rel*)
87	}
88	__rel_dyn_end = .;
89	. = ALIGN(4);
90	_end = .;
91
92	.bss __rel_dyn_start (OVERLAY) : {
93		__bss_start = .;
94		*(.bss)
95		*(COM*)
96		. = ALIGN(4);
97		__bss_end = .;
98	}
99
100	/DISCARD/ : { *(.dynstr*) }
101	/DISCARD/ : { *(.dynamic*) }
102	/DISCARD/ : { *(.plt*) }
103	/DISCARD/ : { *(.interp*) }
104	/DISCARD/ : { *(.gnu*) }
105
106#ifdef CONFIG_X86_16BIT_INIT
107	/*
108	 * The following expressions place the 16-bit Real-Mode code and
109	 * Reset Vector at the end of the Flash ROM
110	 */
111	. = START_16 - RESET_SEG_START;
112	.start16 : AT (START_16) {
113		KEEP(*(.start16));
114	}
115
116	. = RESET_VEC_LOC - RESET_SEG_START;
117	.resetvec : AT (RESET_VEC_LOC) {
118		KEEP(*(.resetvec));
119	}
120#endif
121
122}
123