blob: a283c290eefd00fdc37ee166396b01eb0011d006 [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
15 /DISCARD/ : { *(.u_boot_list_2_cmd_*) }
16#endif
17
Wolfgang Denkc8d76ea2010-10-18 23:43:37 +020018 . = CONFIG_SYS_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);
Marek Vasut55675142012-10-12 10:27:03 +000042 .u_boot_list : {
Albert ARIBAUDef123c52013-02-25 00:59:00 +000043 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*) }
108
Simon Glass972188b2017-01-16 07:03:45 -0700109#ifdef CONFIG_X86_16BIT_INIT
Graeme Russ3a25e942011-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 Russc620c012008-12-07 10:28:57 +1100113 */
Simon Glassa6a95782014-11-14 18:18:25 -0700114 . = START_16 - RESET_SEG_START;
115 .start16 : AT (START_16) {
116 KEEP(*(.start16));
117 }
Graeme Russc620c012008-12-07 10:28:57 +1100118
Simon Glassa6a95782014-11-14 18:18:25 -0700119 . = RESET_VEC_LOC - RESET_SEG_START;
120 .resetvec : AT (RESET_VEC_LOC) {
121 KEEP(*(.resetvec));
122 }
Gabe Blackb16f5212012-11-27 21:08:06 +0000123#endif
Simon Glassa6a95782014-11-14 18:18:25 -0700124
Graeme Russc620c012008-12-07 10:28:57 +1100125}