blob: a31f4220a0008547d8e1e44e713130ba9642381b [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Graeme Russc620c012008-12-07 10:28:57 +11002/*
3 * (C) Copyright 2002
Albert ARIBAUDfa82f872011-08-04 18:45:45 +02004 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
Graeme Russc620c012008-12-07 10:28:57 +11005 */
6
Graeme Russe4135542011-04-13 19:43:25 +10007#include <config.h>
Graeme Russc620c012008-12-07 10:28:57 +11008OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
9OUTPUT_ARCH(i386)
10ENTRY(_start)
11
12SECTIONS
13{
Simon Glassc1352112016-03-13 19:07:29 -060014#ifndef CONFIG_CMDLINE
Andrew Scull99e2fbc2022-05-30 10:00:04 +000015 /DISCARD/ : { *(__u_boot_list_2_cmd_*) }
Simon Glassc1352112016-03-13 19:07:29 -060016#endif
17
Simon Glass98463902022-10-20 18:22:39 -060018 . = CONFIG_TEXT_BASE; /* Location of bootcode in flash */
Graeme Russ067f9b12010-10-07 20:03:31 +110019 __text_start = .;
Alexander Graf7e21fbc2018-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 Russ22191422010-10-07 20:03:32 +110037 .text : { *(.text*); }
Graeme Russc620c012008-12-07 10:28:57 +110038
39 . = ALIGN(4);
Graeme Russc620c012008-12-07 10:28:57 +110040
Graeme Russ22191422010-10-07 20:03:32 +110041 . = ALIGN(4);
Andrew Scull99e2fbc2022-05-30 10:00:04 +000042 __u_boot_list : {
43 KEEP(*(SORT(__u_boot_list*)));
Marek Vasut55675142012-10-12 10:27:03 +000044 }
45
46 . = ALIGN(4);
Simon Glass65e4c0b2016-09-25 15:27:35 -060047 .rodata : {
48 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
49 KEEP(*(.rodata.efi.init));
50 }
Graeme Russ22191422010-10-07 20:03:32 +110051
52 . = ALIGN(4);
53 .data : { *(.data*) }
54
55 . = ALIGN(4);
Graeme Russ22191422010-10-07 20:03:32 +110056 .hash : { *(.hash*) }
57
58 . = ALIGN(4);
59 .got : { *(.got*) }
60
61 . = ALIGN(4);
Simon Glass65e4c0b2016-09-25 15:27:35 -060062
Simon Glass65e4c0b2016-09-25 15:27:35 -060063 .efi_runtime_rel_start :
64 {
65 *(.__efi_runtime_rel_start)
66 }
67
68 .efi_runtime_rel : {
Alexander Graf7e21fbc2018-06-12 07:48:37 +020069 *(.rel*.efi_runtime)
70 *(.rel*.efi_runtime.*)
Simon Glass65e4c0b2016-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 Russ22191422010-10-07 20:03:32 +110080 __data_end = .;
Simon Glass86cfb6b2013-03-05 14:39:54 +000081 __init_end = .;
Graeme Russc620c012008-12-07 10:28:57 +110082
83 . = ALIGN(4);
Simon Glassf82d15e2013-02-28 19:26:14 +000084 .dynsym : { *(.dynsym*) }
Graeme Russc620c012008-12-07 10:28:57 +110085
Graeme Russ22191422010-10-07 20:03:32 +110086 . = ALIGN(4);
87 __rel_dyn_start = .;
Simon Glass091c4942014-11-14 18:18:24 -070088 .rel.dyn : {
89 *(.rel*)
90 }
Graeme Russ22191422010-10-07 20:03:32 +110091 __rel_dyn_end = .;
Simon Glass4b491b82013-02-28 19:26:13 +000092 . = ALIGN(4);
93 _end = .;
Graeme Russ22191422010-10-07 20:03:32 +110094
Simon Glassf82d15e2013-02-28 19:26:14 +000095 .bss __rel_dyn_start (OVERLAY) : {
96 __bss_start = .;
Alexander Graf6331cb22018-08-20 14:17:41 +020097 *(.bss*)
Simon Glassf82d15e2013-02-28 19:26:14 +000098 *(COM*)
99 . = ALIGN(4);
100 __bss_end = .;
101 }
102
Graeme Russ22191422010-10-07 20:03:32 +1100103 /DISCARD/ : { *(.dynstr*) }
104 /DISCARD/ : { *(.dynamic*) }
105 /DISCARD/ : { *(.plt*) }
106 /DISCARD/ : { *(.interp*) }
107 /DISCARD/ : { *(.gnu*) }
Bin Meng6fbe06a2021-06-18 15:09:30 +0800108 /DISCARD/ : { *(.note.gnu.property) }
Graeme Russ22191422010-10-07 20:03:32 +1100109
Simon Glass972188b2017-01-16 07:03:45 -0700110#ifdef CONFIG_X86_16BIT_INIT
Graeme Russ3a25e942011-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 Russc620c012008-12-07 10:28:57 +1100114 */
Simon Glassa6a95782014-11-14 18:18:25 -0700115 . = START_16 - RESET_SEG_START;
116 .start16 : AT (START_16) {
117 KEEP(*(.start16));
118 }
Graeme Russc620c012008-12-07 10:28:57 +1100119
Simon Glassa6a95782014-11-14 18:18:25 -0700120 . = RESET_VEC_LOC - RESET_SEG_START;
121 .resetvec : AT (RESET_VEC_LOC) {
122 KEEP(*(.resetvec));
123 }
Gabe Blackb16f5212012-11-27 21:08:06 +0000124#endif
Simon Glassa6a95782014-11-14 18:18:25 -0700125
Graeme Russc620c012008-12-07 10:28:57 +1100126}