blob: a1cc19ce4cb950efc3ac1dc11554deac66d37f57 [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
15 /DISCARD/ : { *(.u_boot_list_2_cmd_*) }
16#endif
17
Wolfgang Denkfb2759c2010-10-18 23:43:37 +020018 . = CONFIG_SYS_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);
Marek Vasut607092a2012-10-12 10:27:03 +000042 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000043 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 = .;
97 *(.bss)
98 *(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*) }
Graeme Russe56d3972008-12-07 10:28:57 +1100108
Simon Glass706f6f52017-01-16 07:03:45 -0700109#ifdef CONFIG_X86_16BIT_INIT
Graeme Russ3fe48602011-02-12 15:11:24 +1100110 /*
111 * The following expressions place the 16-bit Real-Mode code and
112 * Reset Vector at the end of the Flash ROM
Graeme Russe56d3972008-12-07 10:28:57 +1100113 */
Simon Glass20ec2532014-11-14 18:18:25 -0700114 . = START_16 - RESET_SEG_START;
115 .start16 : AT (START_16) {
116 KEEP(*(.start16));
117 }
Graeme Russe56d3972008-12-07 10:28:57 +1100118
Simon Glass20ec2532014-11-14 18:18:25 -0700119 . = RESET_VEC_LOC - RESET_SEG_START;
120 .resetvec : AT (RESET_VEC_LOC) {
121 KEEP(*(.resetvec));
122 }
Gabe Black14f82462012-11-27 21:08:06 +0000123#endif
Simon Glass20ec2532014-11-14 18:18:25 -0700124
Graeme Russe56d3972008-12-07 10:28:57 +1100125}