blob: 50b4b1608552721473f768a12cb3d20f249206fc [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass9e8dd4f2017-01-16 07:04:02 -07002/*
3 * (C) Copyright 2002
4 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
Simon Glass9e8dd4f2017-01-16 07:04:02 -07005 */
6
7#include <config.h>
8OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
9OUTPUT_ARCH(i386)
10ENTRY(_start)
11
12SECTIONS
13{
Tom Rini2aaa27d2019-01-22 17:09:26 -050014 . = IMAGE_TEXT_BASE; /* Location of bootcode in flash */
Simon Glass9e8dd4f2017-01-16 07:04:02 -070015 __text_start = .;
Simon Glass7a131382019-12-06 21:42:00 -070016 .text : {
17 __image_copy_start = .;
18 *(.text*);
19 }
Simon Glass9e8dd4f2017-01-16 07:04:02 -070020
21 . = ALIGN(4);
22
23 . = ALIGN(4);
Andrew Scull5a9095c2022-05-30 10:00:04 +000024 __u_boot_list : {
25 KEEP(*(SORT(__u_boot_list*)));
Simon Glass9e8dd4f2017-01-16 07:04:02 -070026 }
27
28 . = ALIGN(4);
29 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
30
31 . = ALIGN(4);
Simon Glass92cb9dc2021-03-15 17:25:44 +130032
33 .priv_data : {
34 __priv_data_start = .;
35 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.priv_data*)))
36 __priv_data_end = .;
37 }
38
39 . = ALIGN(4);
Simon Glass9e8dd4f2017-01-16 07:04:02 -070040 .data : { *(.data*) }
41
42 . = ALIGN(4);
43 __data_end = .;
44 __init_end = .;
Simon Glass5a4e0182019-09-25 08:11:36 -060045 . = ALIGN(4);
46 .binman_sym_table : {
47 __binman_sym_start = .;
48 KEEP(*(SORT(.binman_sym*)));
49 __binman_sym_end = .;
Simon Glassbe6f9582021-01-24 10:06:05 -070050
51 /*
52 * Force 32-byte alignment so that it lines up with the start of
53 * bss, which may have up to 32-byte alignment. This ensures
54 * that the end of the .bin file matches up with
55 * _image_binary_end or __bss_end - see board_fdt_blob_setup().
56 * The alignment of BSS depends on what is in it, so can range
57 * from 4 to 32 bytes.
58 */
59 . = ALIGN(32);
Simon Glass5a4e0182019-09-25 08:11:36 -060060 }
Simon Glass9e8dd4f2017-01-16 07:04:02 -070061
62 _image_binary_end = .;
63
Simon Glass8dda5962021-01-24 10:06:06 -070064#if CONFIG_IS_ENABLED(SEPARATE_BSS)
Simon Glass9e8dd4f2017-01-16 07:04:02 -070065 . = 0x120000;
Simon Glass8dda5962021-01-24 10:06:06 -070066#endif
Simon Glass9e8dd4f2017-01-16 07:04:02 -070067 .bss (OVERLAY) : {
68 __bss_start = .;
69 *(.bss*)
70 *(COM*)
71 . = ALIGN(4);
72 __bss_end = .;
73 }
74 __bss_size = __bss_end - __bss_start;
75
76 /DISCARD/ : { *(.dynstr*) }
77 /DISCARD/ : { *(.dynamic*) }
78 /DISCARD/ : { *(.plt*) }
79 /DISCARD/ : { *(.interp*) }
80 /DISCARD/ : { *(.gnu*) }
Bin Meng3eb15f52021-06-18 15:09:30 +080081 /DISCARD/ : { *(.note.gnu.property) }
Simon Glass9e8dd4f2017-01-16 07:04:02 -070082
Simon Glass79ef6992019-04-25 21:58:53 -060083#if defined(CONFIG_SPL_X86_16BIT_INIT) || defined(CONFIG_TPL_X86_16BIT_INIT)
Simon Glass9e8dd4f2017-01-16 07:04:02 -070084 /*
85 * The following expressions place the 16-bit Real-Mode code and
86 * Reset Vector at the end of the Flash ROM
87 */
88 . = START_16 - RESET_SEG_START;
89 .start16 : AT (START_16) {
90 KEEP(*(.start16));
91 }
92
93 . = RESET_VEC_LOC - RESET_SEG_START;
94 .resetvec : AT (RESET_VEC_LOC) {
95 KEEP(*(.resetvec));
96 }
97#endif
98
99}