blob: a0a2a06a18cd6d897fdbd9af37c3163933782bce [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
Andrew Scull99e2fbc2022-05-30 10:00:04 +000015 /DISCARD/ : { *(__u_boot_list_2_cmd_*) }
Simon Glass3c2dd5372017-01-16 07:04:02 -070016#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);
Andrew Scull99e2fbc2022-05-30 10:00:04 +000028 __u_boot_list : {
29 KEEP(*(SORT(__u_boot_list*)));
Simon Glass3c2dd5372017-01-16 07:04:02 -070030 }
31
32 . = ALIGN(4);
33 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
34
35 . = ALIGN(4);
Simon Glass72db28e2021-03-15 17:25:44 +130036
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);
Simon Glass3c2dd5372017-01-16 07:04:02 -070044 .data : { *(.data*) }
45
46 . = ALIGN(4);
47 __data_end = .;
48 __init_end = .;
Simon Glass1eeb5572019-09-25 08:11:36 -060049 . = ALIGN(4);
50 .binman_sym_table : {
51 __binman_sym_start = .;
52 KEEP(*(SORT(.binman_sym*)));
53 __binman_sym_end = .;
Simon Glass37c664e2021-01-24 10:06:05 -070054
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);
Simon Glass1eeb5572019-09-25 08:11:36 -060064 }
Simon Glass3c2dd5372017-01-16 07:04:02 -070065
66 _image_binary_end = .;
67
Simon Glass76baecf2021-01-24 10:06:06 -070068#if CONFIG_IS_ENABLED(SEPARATE_BSS)
Simon Glass3c2dd5372017-01-16 07:04:02 -070069 . = 0x120000;
Simon Glass76baecf2021-01-24 10:06:06 -070070#endif
Simon Glass3c2dd5372017-01-16 07:04:02 -070071 .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*) }
Bin Meng6fbe06a2021-06-18 15:09:30 +080085 /DISCARD/ : { *(.note.gnu.property) }
Simon Glass3c2dd5372017-01-16 07:04:02 -070086
Simon Glassd68574a2019-04-25 21:58:53 -060087#if defined(CONFIG_SPL_X86_16BIT_INIT) || defined(CONFIG_TPL_X86_16BIT_INIT)
Simon Glass3c2dd5372017-01-16 07:04:02 -070088 /*
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}