blob: c418ff44aa086ab1aae4a27209d126b3274970f1 [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 Glass72cc5382022-10-20 18:22:39 -060014 . = CONFIG_TEXT_BASE; /* Location of bootcode in flash */
Graeme Russae428db2010-10-07 20:03:31 +110015 __text_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020016
17 .text.start : { *(.text.start); }
18
19 .__efi_runtime_start : {
20 *(.__efi_runtime_start)
21 }
22
23 .efi_runtime : {
24 *(.text.efi_runtime*)
25 *(.rodata.efi_runtime*)
26 *(.data.efi_runtime*)
27 }
28
29 .__efi_runtime_stop : {
30 *(.__efi_runtime_stop)
31 }
32
Graeme Russfb4e2be2010-10-07 20:03:32 +110033 .text : { *(.text*); }
Graeme Russe56d3972008-12-07 10:28:57 +110034
35 . = ALIGN(4);
Graeme Russ078395c2009-11-24 20:04:21 +110036
Graeme Russ078395c2009-11-24 20:04:21 +110037 . = ALIGN(4);
Andrew Scull5a9095c2022-05-30 10:00:04 +000038 __u_boot_list : {
39 KEEP(*(SORT(__u_boot_list*)));
Marek Vasut607092a2012-10-12 10:27:03 +000040 }
41
42 . = ALIGN(4);
Simon Glasscdfe6962016-09-25 15:27:35 -060043 .rodata : {
44 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
45 KEEP(*(.rodata.efi.init));
46 }
Graeme Russ078395c2009-11-24 20:04:21 +110047
Graeme Russ078395c2009-11-24 20:04:21 +110048 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110049 .data : { *(.data*) }
Graeme Russe56d3972008-12-07 10:28:57 +110050
Graeme Russ078395c2009-11-24 20:04:21 +110051 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110052 .hash : { *(.hash*) }
Graeme Russe56d3972008-12-07 10:28:57 +110053
54 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110055 .got : { *(.got*) }
Graeme Russe56d3972008-12-07 10:28:57 +110056
57 . = ALIGN(4);
Simon Glasscdfe6962016-09-25 15:27:35 -060058
Simon Glasscdfe6962016-09-25 15:27:35 -060059 .efi_runtime_rel_start :
60 {
61 *(.__efi_runtime_rel_start)
62 }
63
64 .efi_runtime_rel : {
Alexander Graf94a10f22018-06-12 07:48:37 +020065 *(.rel*.efi_runtime)
66 *(.rel*.efi_runtime.*)
Simon Glasscdfe6962016-09-25 15:27:35 -060067 }
68
69 .efi_runtime_rel_stop :
70 {
71 *(.__efi_runtime_rel_stop)
72 }
73
74 . = ALIGN(4);
75
Graeme Russfb4e2be2010-10-07 20:03:32 +110076 __data_end = .;
Simon Glass3e93e332013-03-05 14:39:54 +000077 __init_end = .;
Graeme Russ078395c2009-11-24 20:04:21 +110078
Graeme Russ078395c2009-11-24 20:04:21 +110079 . = ALIGN(4);
Simon Glass18cc2bc2013-02-28 19:26:14 +000080 .dynsym : { *(.dynsym*) }
Graeme Russ078395c2009-11-24 20:04:21 +110081
Graeme Russ078395c2009-11-24 20:04:21 +110082 . = ALIGN(4);
Graeme Russae428db2010-10-07 20:03:31 +110083 __rel_dyn_start = .;
Simon Glass1eb8ebc2014-11-14 18:18:24 -070084 .rel.dyn : {
85 *(.rel*)
86 }
Graeme Russae428db2010-10-07 20:03:31 +110087 __rel_dyn_end = .;
Simon Glass781db8c2013-02-28 19:26:13 +000088 . = ALIGN(4);
89 _end = .;
Graeme Russe56d3972008-12-07 10:28:57 +110090
Simon Glass18cc2bc2013-02-28 19:26:14 +000091 .bss __rel_dyn_start (OVERLAY) : {
92 __bss_start = .;
Alexander Graf61c76782018-08-20 14:17:41 +020093 *(.bss*)
Simon Glass18cc2bc2013-02-28 19:26:14 +000094 *(COM*)
95 . = ALIGN(4);
96 __bss_end = .;
97 }
98
Graeme Russfb4e2be2010-10-07 20:03:32 +110099 /DISCARD/ : { *(.dynstr*) }
100 /DISCARD/ : { *(.dynamic*) }
101 /DISCARD/ : { *(.plt*) }
102 /DISCARD/ : { *(.interp*) }
103 /DISCARD/ : { *(.gnu*) }
Bin Meng3eb15f52021-06-18 15:09:30 +0800104 /DISCARD/ : { *(.note.gnu.property) }
Graeme Russe56d3972008-12-07 10:28:57 +1100105
Simon Glass706f6f52017-01-16 07:03:45 -0700106#ifdef CONFIG_X86_16BIT_INIT
Graeme Russ3fe48602011-02-12 15:11:24 +1100107 /*
108 * The following expressions place the 16-bit Real-Mode code and
109 * Reset Vector at the end of the Flash ROM
Graeme Russe56d3972008-12-07 10:28:57 +1100110 */
Simon Glass20ec2532014-11-14 18:18:25 -0700111 . = START_16 - RESET_SEG_START;
112 .start16 : AT (START_16) {
113 KEEP(*(.start16));
114 }
Graeme Russe56d3972008-12-07 10:28:57 +1100115
Simon Glass20ec2532014-11-14 18:18:25 -0700116 . = RESET_VEC_LOC - RESET_SEG_START;
117 .resetvec : AT (RESET_VEC_LOC) {
118 KEEP(*(.resetvec));
119 }
Gabe Black14f82462012-11-27 21:08:06 +0000120#endif
Simon Glass20ec2532014-11-14 18:18:25 -0700121
Graeme Russe56d3972008-12-07 10:28:57 +1100122}