1/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * (C) Copyright 2002
4 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
5 */
6
7#include <config.h>
8OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
9OUTPUT_ARCH(i386)
10ENTRY(_start)
11
12SECTIONS
13{
14#ifndef CONFIG_CMDLINE
15	/DISCARD/ : { *(.u_boot_list_2_cmd_*) }
16#endif
17
18	. = IMAGE_TEXT_BASE;	/* Location of bootcode in flash */
19	__text_start = .;
20	.text  : {
21		__image_copy_start = .;
22		*(.text*);
23	}
24
25	. = ALIGN(4);
26
27	. = ALIGN(4);
28	.u_boot_list : {
29		KEEP(*(SORT(.u_boot_list*)));
30	}
31
32	. = ALIGN(4);
33	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
34
35	. = ALIGN(4);
36
37	.priv_data : {
38		__priv_data_start = .;
39		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.priv_data*)))
40		__priv_data_end = .;
41	}
42
43	. = ALIGN(4);
44	.data : { *(.data*) }
45
46	. = ALIGN(4);
47	__data_end = .;
48	__init_end = .;
49	. = ALIGN(4);
50	.binman_sym_table : {
51		__binman_sym_start = .;
52		KEEP(*(SORT(.binman_sym*)));
53		__binman_sym_end = .;
54
55		/*
56		 * Force 32-byte alignment so that it lines up with the start of
57		 * bss, which may have up to 32-byte alignment. This ensures
58		 * that the end of the .bin file matches up with
59		 * _image_binary_end or __bss_end - see board_fdt_blob_setup().
60		 * The alignment of BSS depends on what is in it, so can range
61		 * from 4 to 32 bytes.
62		 */
63		. = ALIGN(32);
64	}
65
66        _image_binary_end = .;
67
68#if CONFIG_IS_ENABLED(SEPARATE_BSS)
69	. = 0x120000;
70#endif
71	.bss (OVERLAY) : {
72		__bss_start = .;
73		*(.bss*)
74		*(COM*)
75		. = ALIGN(4);
76		__bss_end = .;
77	}
78	__bss_size = __bss_end - __bss_start;
79
80	/DISCARD/ : { *(.dynstr*) }
81	/DISCARD/ : { *(.dynamic*) }
82	/DISCARD/ : { *(.plt*) }
83	/DISCARD/ : { *(.interp*) }
84	/DISCARD/ : { *(.gnu*) }
85	/DISCARD/ : { *(.note.gnu.property) }
86
87#if defined(CONFIG_SPL_X86_16BIT_INIT) || defined(CONFIG_TPL_X86_16BIT_INIT)
88	/*
89	 * The following expressions place the 16-bit Real-Mode code and
90	 * Reset Vector at the end of the Flash ROM
91	 */
92	. = START_16 - RESET_SEG_START;
93	.start16 : AT (START_16) {
94		KEEP(*(.start16));
95	}
96
97	. = RESET_VEC_LOC - RESET_SEG_START;
98	.resetvec : AT (RESET_VEC_LOC) {
99		KEEP(*(.resetvec));
100	}
101#endif
102
103}
104