blob: 186718d8f9dff88df7dc43a2b6f3d9464edb47bd [file] [log] [blame]
Graeme Russc620c012008-12-07 10:28:57 +11001/*
2 * (C) Copyright 2002
Albert ARIBAUDfa82f872011-08-04 18:45:45 +02003 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
Graeme Russc620c012008-12-07 10:28:57 +11004 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Graeme Russc620c012008-12-07 10:28:57 +11006 */
7
Graeme Russe4135542011-04-13 19:43:25 +10008#include <config.h>
Graeme Russc620c012008-12-07 10:28:57 +11009OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
10OUTPUT_ARCH(i386)
11ENTRY(_start)
12
13SECTIONS
14{
Simon Glassc1352112016-03-13 19:07:29 -060015#ifndef CONFIG_CMDLINE
16 /DISCARD/ : { *(.u_boot_list_2_cmd_*) }
17#endif
18
Wolfgang Denkc8d76ea2010-10-18 23:43:37 +020019 . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */
Graeme Russ067f9b12010-10-07 20:03:31 +110020 __text_start = .;
Graeme Russ22191422010-10-07 20:03:32 +110021 .text : { *(.text*); }
Graeme Russc620c012008-12-07 10:28:57 +110022
23 . = ALIGN(4);
Graeme Russc620c012008-12-07 10:28:57 +110024
Graeme Russ22191422010-10-07 20:03:32 +110025 . = ALIGN(4);
Marek Vasut55675142012-10-12 10:27:03 +000026 .u_boot_list : {
Albert ARIBAUDef123c52013-02-25 00:59:00 +000027 KEEP(*(SORT(.u_boot_list*)));
Marek Vasut55675142012-10-12 10:27:03 +000028 }
29
30 . = ALIGN(4);
Simon Glass65e4c0b2016-09-25 15:27:35 -060031 .rodata : {
32 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
33 KEEP(*(.rodata.efi.init));
34 }
Graeme Russ22191422010-10-07 20:03:32 +110035
36 . = ALIGN(4);
37 .data : { *(.data*) }
38
39 . = ALIGN(4);
Graeme Russ22191422010-10-07 20:03:32 +110040 .hash : { *(.hash*) }
41
42 . = ALIGN(4);
43 .got : { *(.got*) }
44
45 . = ALIGN(4);
Simon Glass65e4c0b2016-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 Russ22191422010-10-07 20:03:32 +110077 __data_end = .;
Simon Glass86cfb6b2013-03-05 14:39:54 +000078 __init_end = .;
Graeme Russc620c012008-12-07 10:28:57 +110079
80 . = ALIGN(4);
Simon Glassf82d15e2013-02-28 19:26:14 +000081 .dynsym : { *(.dynsym*) }
Graeme Russc620c012008-12-07 10:28:57 +110082
Graeme Russ22191422010-10-07 20:03:32 +110083 . = ALIGN(4);
84 __rel_dyn_start = .;
Simon Glass091c4942014-11-14 18:18:24 -070085 .rel.dyn : {
86 *(.rel*)
87 }
Graeme Russ22191422010-10-07 20:03:32 +110088 __rel_dyn_end = .;
Simon Glass4b491b82013-02-28 19:26:13 +000089 . = ALIGN(4);
90 _end = .;
Graeme Russ22191422010-10-07 20:03:32 +110091
Simon Glassf82d15e2013-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 Russ22191422010-10-07 20:03:32 +1100100 /DISCARD/ : { *(.dynstr*) }
101 /DISCARD/ : { *(.dynamic*) }
102 /DISCARD/ : { *(.plt*) }
103 /DISCARD/ : { *(.interp*) }
104 /DISCARD/ : { *(.gnu*) }
105
Simon Glass972188b2017-01-16 07:03:45 -0700106#ifdef CONFIG_X86_16BIT_INIT
Graeme Russ3a25e942011-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 Russc620c012008-12-07 10:28:57 +1100110 */
Simon Glassa6a95782014-11-14 18:18:25 -0700111 . = START_16 - RESET_SEG_START;
112 .start16 : AT (START_16) {
113 KEEP(*(.start16));
114 }
Graeme Russc620c012008-12-07 10:28:57 +1100115
Simon Glassa6a95782014-11-14 18:18:25 -0700116 . = RESET_VEC_LOC - RESET_SEG_START;
117 .resetvec : AT (RESET_VEC_LOC) {
118 KEEP(*(.resetvec));
119 }
Gabe Blackb16f5212012-11-27 21:08:06 +0000120#endif
Simon Glassa6a95782014-11-14 18:18:25 -0700121
Graeme Russc620c012008-12-07 10:28:57 +1100122}