blob: b82e53ab1240dc393c943d111d859061d7b2d8c7 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass3c2dd5372017-01-16 07:04:02 -07002/*
3 * (C) Copyright 2002
4 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
Simon Glass3c2dd5372017-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{
14#ifndef CONFIG_CMDLINE
15 /DISCARD/ : { *(.u_boot_list_2_cmd_*) }
16#endif
17
Tom Rini2f41ade2019-01-22 17:09:26 -050018 . = IMAGE_TEXT_BASE; /* Location of bootcode in flash */
Simon Glass3c2dd5372017-01-16 07:04:02 -070019 __text_start = .;
Simon Glassb93757c2019-12-06 21:42:00 -070020 .text : {
21 __image_copy_start = .;
22 *(.text*);
23 }
Simon Glass3c2dd5372017-01-16 07:04:02 -070024
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 .data : { *(.data*) }
37
38 . = ALIGN(4);
39 __data_end = .;
40 __init_end = .;
Simon Glass1eeb5572019-09-25 08:11:36 -060041 . = ALIGN(4);
42 .binman_sym_table : {
43 __binman_sym_start = .;
44 KEEP(*(SORT(.binman_sym*)));
45 __binman_sym_end = .;
Simon Glass37c664e2021-01-24 10:06:05 -070046
47 /*
48 * Force 32-byte alignment so that it lines up with the start of
49 * bss, which may have up to 32-byte alignment. This ensures
50 * that the end of the .bin file matches up with
51 * _image_binary_end or __bss_end - see board_fdt_blob_setup().
52 * The alignment of BSS depends on what is in it, so can range
53 * from 4 to 32 bytes.
54 */
55 . = ALIGN(32);
Simon Glass1eeb5572019-09-25 08:11:36 -060056 }
Simon Glass3c2dd5372017-01-16 07:04:02 -070057
58 _image_binary_end = .;
59
Simon Glass76baecf2021-01-24 10:06:06 -070060#if CONFIG_IS_ENABLED(SEPARATE_BSS)
Simon Glass3c2dd5372017-01-16 07:04:02 -070061 . = 0x120000;
Simon Glass76baecf2021-01-24 10:06:06 -070062#endif
Simon Glass3c2dd5372017-01-16 07:04:02 -070063 .bss (OVERLAY) : {
64 __bss_start = .;
65 *(.bss*)
66 *(COM*)
67 . = ALIGN(4);
68 __bss_end = .;
69 }
70 __bss_size = __bss_end - __bss_start;
71
72 /DISCARD/ : { *(.dynstr*) }
73 /DISCARD/ : { *(.dynamic*) }
74 /DISCARD/ : { *(.plt*) }
75 /DISCARD/ : { *(.interp*) }
76 /DISCARD/ : { *(.gnu*) }
77
Simon Glassd68574a2019-04-25 21:58:53 -060078#if defined(CONFIG_SPL_X86_16BIT_INIT) || defined(CONFIG_TPL_X86_16BIT_INIT)
Simon Glass3c2dd5372017-01-16 07:04:02 -070079 /*
80 * The following expressions place the 16-bit Real-Mode code and
81 * Reset Vector at the end of the Flash ROM
82 */
83 . = START_16 - RESET_SEG_START;
84 .start16 : AT (START_16) {
85 KEEP(*(.start16));
86 }
87
88 . = RESET_VEC_LOC - RESET_SEG_START;
89 .resetvec : AT (RESET_VEC_LOC) {
90 KEEP(*(.resetvec));
91 }
92#endif
93
94}