blob: a31f4220a0008547d8e1e44e713130ba9642381b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Graeme Russe56d3972008-12-07 10:28:57 +11002/*
3 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02004 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
Graeme Russe56d3972008-12-07 10:28:57 +11005 */
6
Graeme Russc5881f12011-04-13 19:43:25 +10007#include <config.h>
Graeme Russe56d3972008-12-07 10:28:57 +11008OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
9OUTPUT_ARCH(i386)
10ENTRY(_start)
11
12SECTIONS
13{
Simon Glass3e2c91c2016-03-13 19:07:29 -060014#ifndef CONFIG_CMDLINE
Andrew Scull5a9095c2022-05-30 10:00:04 +000015 /DISCARD/ : { *(__u_boot_list_2_cmd_*) }
Simon Glass3e2c91c2016-03-13 19:07:29 -060016#endif
17
Simon Glass72cc5382022-10-20 18:22:39 -060018 . = CONFIG_TEXT_BASE; /* Location of bootcode in flash */
Graeme Russae428db2010-10-07 20:03:31 +110019 __text_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020020
21 .text.start : { *(.text.start); }
22
23 .__efi_runtime_start : {
24 *(.__efi_runtime_start)
25 }
26
27 .efi_runtime : {
28 *(.text.efi_runtime*)
29 *(.rodata.efi_runtime*)
30 *(.data.efi_runtime*)
31 }
32
33 .__efi_runtime_stop : {
34 *(.__efi_runtime_stop)
35 }
36
Graeme Russfb4e2be2010-10-07 20:03:32 +110037 .text : { *(.text*); }
Graeme Russe56d3972008-12-07 10:28:57 +110038
39 . = ALIGN(4);
Graeme Russ078395c2009-11-24 20:04:21 +110040
Graeme Russ078395c2009-11-24 20:04:21 +110041 . = ALIGN(4);
Andrew Scull5a9095c2022-05-30 10:00:04 +000042 __u_boot_list : {
43 KEEP(*(SORT(__u_boot_list*)));
Marek Vasut607092a2012-10-12 10:27:03 +000044 }
45
46 . = ALIGN(4);
Simon Glasscdfe6962016-09-25 15:27:35 -060047 .rodata : {
48 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
49 KEEP(*(.rodata.efi.init));
50 }
Graeme Russ078395c2009-11-24 20:04:21 +110051
Graeme Russ078395c2009-11-24 20:04:21 +110052 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110053 .data : { *(.data*) }
Graeme Russe56d3972008-12-07 10:28:57 +110054
Graeme Russ078395c2009-11-24 20:04:21 +110055 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110056 .hash : { *(.hash*) }
Graeme Russe56d3972008-12-07 10:28:57 +110057
58 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110059 .got : { *(.got*) }
Graeme Russe56d3972008-12-07 10:28:57 +110060
61 . = ALIGN(4);
Simon Glasscdfe6962016-09-25 15:27:35 -060062
Simon Glasscdfe6962016-09-25 15:27:35 -060063 .efi_runtime_rel_start :
64 {
65 *(.__efi_runtime_rel_start)
66 }
67
68 .efi_runtime_rel : {
Alexander Graf94a10f22018-06-12 07:48:37 +020069 *(.rel*.efi_runtime)
70 *(.rel*.efi_runtime.*)
Simon Glasscdfe6962016-09-25 15:27:35 -060071 }
72
73 .efi_runtime_rel_stop :
74 {
75 *(.__efi_runtime_rel_stop)
76 }
77
78 . = ALIGN(4);
79
Graeme Russfb4e2be2010-10-07 20:03:32 +110080 __data_end = .;
Simon Glass3e93e332013-03-05 14:39:54 +000081 __init_end = .;
Graeme Russ078395c2009-11-24 20:04:21 +110082
Graeme Russ078395c2009-11-24 20:04:21 +110083 . = ALIGN(4);
Simon Glass18cc2bc2013-02-28 19:26:14 +000084 .dynsym : { *(.dynsym*) }
Graeme Russ078395c2009-11-24 20:04:21 +110085
Graeme Russ078395c2009-11-24 20:04:21 +110086 . = ALIGN(4);
Graeme Russae428db2010-10-07 20:03:31 +110087 __rel_dyn_start = .;
Simon Glass1eb8ebc2014-11-14 18:18:24 -070088 .rel.dyn : {
89 *(.rel*)
90 }
Graeme Russae428db2010-10-07 20:03:31 +110091 __rel_dyn_end = .;
Simon Glass781db8c2013-02-28 19:26:13 +000092 . = ALIGN(4);
93 _end = .;
Graeme Russe56d3972008-12-07 10:28:57 +110094
Simon Glass18cc2bc2013-02-28 19:26:14 +000095 .bss __rel_dyn_start (OVERLAY) : {
96 __bss_start = .;
Alexander Graf61c76782018-08-20 14:17:41 +020097 *(.bss*)
Simon Glass18cc2bc2013-02-28 19:26:14 +000098 *(COM*)
99 . = ALIGN(4);
100 __bss_end = .;
101 }
102
Graeme Russfb4e2be2010-10-07 20:03:32 +1100103 /DISCARD/ : { *(.dynstr*) }
104 /DISCARD/ : { *(.dynamic*) }
105 /DISCARD/ : { *(.plt*) }
106 /DISCARD/ : { *(.interp*) }
107 /DISCARD/ : { *(.gnu*) }
Bin Meng3eb15f52021-06-18 15:09:30 +0800108 /DISCARD/ : { *(.note.gnu.property) }
Graeme Russe56d3972008-12-07 10:28:57 +1100109
Simon Glass706f6f52017-01-16 07:03:45 -0700110#ifdef CONFIG_X86_16BIT_INIT
Graeme Russ3fe48602011-02-12 15:11:24 +1100111 /*
112 * The following expressions place the 16-bit Real-Mode code and
113 * Reset Vector at the end of the Flash ROM
Graeme Russe56d3972008-12-07 10:28:57 +1100114 */
Simon Glass20ec2532014-11-14 18:18:25 -0700115 . = START_16 - RESET_SEG_START;
116 .start16 : AT (START_16) {
117 KEEP(*(.start16));
118 }
Graeme Russe56d3972008-12-07 10:28:57 +1100119
Simon Glass20ec2532014-11-14 18:18:25 -0700120 . = RESET_VEC_LOC - RESET_SEG_START;
121 .resetvec : AT (RESET_VEC_LOC) {
122 KEEP(*(.resetvec));
123 }
Gabe Black14f82462012-11-27 21:08:06 +0000124#endif
Simon Glass20ec2532014-11-14 18:18:25 -0700125
Graeme Russe56d3972008-12-07 10:28:57 +1100126}