blob: 186718d8f9dff88df7dc43a2b6f3d9464edb47bd [file] [log] [blame]
Graeme Russe56d3972008-12-07 10:28:57 +11001/*
2 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02003 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
Graeme Russe56d3972008-12-07 10:28:57 +11004 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Graeme Russe56d3972008-12-07 10:28:57 +11006 */
7
Graeme Russc5881f12011-04-13 19:43:25 +10008#include <config.h>
Graeme Russe56d3972008-12-07 10:28:57 +11009OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
10OUTPUT_ARCH(i386)
11ENTRY(_start)
12
13SECTIONS
14{
Simon Glass3e2c91c2016-03-13 19:07:29 -060015#ifndef CONFIG_CMDLINE
16 /DISCARD/ : { *(.u_boot_list_2_cmd_*) }
17#endif
18
Wolfgang Denkfb2759c2010-10-18 23:43:37 +020019 . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */
Graeme Russae428db2010-10-07 20:03:31 +110020 __text_start = .;
Graeme Russfb4e2be2010-10-07 20:03:32 +110021 .text : { *(.text*); }
Graeme Russe56d3972008-12-07 10:28:57 +110022
23 . = ALIGN(4);
Graeme Russ078395c2009-11-24 20:04:21 +110024
Graeme Russ078395c2009-11-24 20:04:21 +110025 . = ALIGN(4);
Marek Vasut607092a2012-10-12 10:27:03 +000026 .u_boot_list : {
Albert ARIBAUDc24895e2013-02-25 00:59:00 +000027 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut607092a2012-10-12 10:27:03 +000028 }
29
30 . = ALIGN(4);
Simon Glasscdfe6962016-09-25 15:27:35 -060031 .rodata : {
32 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
33 KEEP(*(.rodata.efi.init));
34 }
Graeme Russ078395c2009-11-24 20:04:21 +110035
Graeme Russ078395c2009-11-24 20:04:21 +110036 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110037 .data : { *(.data*) }
Graeme Russe56d3972008-12-07 10:28:57 +110038
Graeme Russ078395c2009-11-24 20:04:21 +110039 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110040 .hash : { *(.hash*) }
Graeme Russe56d3972008-12-07 10:28:57 +110041
42 . = ALIGN(4);
Graeme Russfb4e2be2010-10-07 20:03:32 +110043 .got : { *(.got*) }
Graeme Russe56d3972008-12-07 10:28:57 +110044
45 . = ALIGN(4);
Simon Glasscdfe6962016-09-25 15:27:35 -060046
47 .__efi_runtime_start : {
48 *(.__efi_runtime_start)
49 }
50
51 .efi_runtime : {
52 *(efi_runtime_text)
53 *(efi_runtime_data)
54 }
55
56 .__efi_runtime_stop : {
57 *(.__efi_runtime_stop)
58 }
59
60 .efi_runtime_rel_start :
61 {
62 *(.__efi_runtime_rel_start)
63 }
64
65 .efi_runtime_rel : {
66 *(.relefi_runtime_text)
67 *(.relefi_runtime_data)
68 }
69
70 .efi_runtime_rel_stop :
71 {
72 *(.__efi_runtime_rel_stop)
73 }
74
75 . = ALIGN(4);
76
Graeme Russfb4e2be2010-10-07 20:03:32 +110077 __data_end = .;
Simon Glass3e93e332013-03-05 14:39:54 +000078 __init_end = .;
Graeme Russ078395c2009-11-24 20:04:21 +110079
Graeme Russ078395c2009-11-24 20:04:21 +110080 . = ALIGN(4);
Simon Glass18cc2bc2013-02-28 19:26:14 +000081 .dynsym : { *(.dynsym*) }
Graeme Russ078395c2009-11-24 20:04:21 +110082
Graeme Russ078395c2009-11-24 20:04:21 +110083 . = ALIGN(4);
Graeme Russae428db2010-10-07 20:03:31 +110084 __rel_dyn_start = .;
Simon Glass1eb8ebc2014-11-14 18:18:24 -070085 .rel.dyn : {
86 *(.rel*)
87 }
Graeme Russae428db2010-10-07 20:03:31 +110088 __rel_dyn_end = .;
Simon Glass781db8c2013-02-28 19:26:13 +000089 . = ALIGN(4);
90 _end = .;
Graeme Russe56d3972008-12-07 10:28:57 +110091
Simon Glass18cc2bc2013-02-28 19:26:14 +000092 .bss __rel_dyn_start (OVERLAY) : {
93 __bss_start = .;
94 *(.bss)
95 *(COM*)
96 . = ALIGN(4);
97 __bss_end = .;
98 }
99
Graeme Russfb4e2be2010-10-07 20:03:32 +1100100 /DISCARD/ : { *(.dynstr*) }
101 /DISCARD/ : { *(.dynamic*) }
102 /DISCARD/ : { *(.plt*) }
103 /DISCARD/ : { *(.interp*) }
104 /DISCARD/ : { *(.gnu*) }
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}