Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2004-2008 Texas Instruments |
| 3 | * |
| 4 | * (C) Copyright 2002 |
| 5 | * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de> |
| 6 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | * SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
Marc Zyngier | c0451ec | 2014-07-12 14:24:02 +0100 | [diff] [blame] | 10 | #include <config.h> |
| 11 | |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 12 | OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") |
| 13 | OUTPUT_ARCH(arm) |
| 14 | ENTRY(_start) |
| 15 | SECTIONS |
| 16 | { |
Simon Glass | 3e2c91c | 2016-03-13 19:07:29 -0600 | [diff] [blame] | 17 | #ifndef CONFIG_CMDLINE |
| 18 | /DISCARD/ : { *(.u_boot_list_2_cmd_*) } |
| 19 | #endif |
Wang Dongsheng | 7eab3a6 | 2016-01-18 11:02:40 +0800 | [diff] [blame] | 20 | #if defined(CONFIG_ARMV7_SECURE_BASE) && defined(CONFIG_ARMV7_NONSEC) |
Peng Fan | 2e9e9a8 | 2015-10-23 10:13:03 +0800 | [diff] [blame] | 21 | /* |
Wang Dongsheng | 7eab3a6 | 2016-01-18 11:02:40 +0800 | [diff] [blame] | 22 | * If CONFIG_ARMV7_SECURE_BASE is true, secure code will not |
| 23 | * bundle with u-boot, and code offsets are fixed. Secure zone |
| 24 | * only needs to be copied from the loading address to |
| 25 | * CONFIG_ARMV7_SECURE_BASE, which is the linking and running |
| 26 | * address for secure code. |
Peng Fan | 2e9e9a8 | 2015-10-23 10:13:03 +0800 | [diff] [blame] | 27 | * |
Wang Dongsheng | 7eab3a6 | 2016-01-18 11:02:40 +0800 | [diff] [blame] | 28 | * If CONFIG_ARMV7_SECURE_BASE is undefined, the secure zone will |
| 29 | * be included in u-boot address space, and some absolute address |
| 30 | * were used in secure code. The absolute addresses of the secure |
| 31 | * code also needs to be relocated along with the accompanying u-boot |
| 32 | * code. |
| 33 | * |
| 34 | * So DISCARD is only for CONFIG_ARMV7_SECURE_BASE. |
Peng Fan | 2e9e9a8 | 2015-10-23 10:13:03 +0800 | [diff] [blame] | 35 | */ |
| 36 | /DISCARD/ : { *(.rel._secure*) } |
Wang Dongsheng | 7eab3a6 | 2016-01-18 11:02:40 +0800 | [diff] [blame] | 37 | #endif |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 38 | . = 0x00000000; |
| 39 | |
| 40 | . = ALIGN(4); |
| 41 | .text : |
| 42 | { |
Albert ARIBAUD | c53687e | 2013-06-11 14:17:33 +0200 | [diff] [blame] | 43 | *(.__image_copy_start) |
Albert ARIBAUD | 9852cc6 | 2014-04-15 16:13:51 +0200 | [diff] [blame] | 44 | *(.vectors) |
Stephen Warren | adddf45 | 2012-10-22 06:19:32 +0000 | [diff] [blame] | 45 | CPUDIR/start.o (.text*) |
| 46 | *(.text*) |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 47 | } |
Marc Zyngier | c0451ec | 2014-07-12 14:24:02 +0100 | [diff] [blame] | 48 | |
Jan Kiszka | ac31b5a | 2015-04-21 07:18:24 +0200 | [diff] [blame] | 49 | #ifdef CONFIG_ARMV7_NONSEC |
Marc Zyngier | c0451ec | 2014-07-12 14:24:02 +0100 | [diff] [blame] | 50 | |
| 51 | #ifndef CONFIG_ARMV7_SECURE_BASE |
| 52 | #define CONFIG_ARMV7_SECURE_BASE |
| 53 | #endif |
| 54 | |
| 55 | .__secure_start : { |
| 56 | . = ALIGN(0x1000); |
| 57 | *(.__secure_start) |
| 58 | } |
| 59 | |
| 60 | .secure_text CONFIG_ARMV7_SECURE_BASE : |
| 61 | AT(ADDR(.__secure_start) + SIZEOF(.__secure_start)) |
| 62 | { |
| 63 | *(._secure.text) |
| 64 | } |
| 65 | |
| 66 | . = LOADADDR(.__secure_start) + |
| 67 | SIZEOF(.__secure_start) + |
| 68 | SIZEOF(.secure_text); |
| 69 | |
| 70 | __secure_end_lma = .; |
| 71 | .__secure_end : AT(__secure_end_lma) { |
| 72 | *(.__secure_end) |
| 73 | LONG(0x1d1071c); /* Must output something to reset LMA */ |
| 74 | } |
| 75 | #endif |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 76 | |
| 77 | . = ALIGN(4); |
| 78 | .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } |
| 79 | |
| 80 | . = ALIGN(4); |
| 81 | .data : { |
Stephen Warren | adddf45 | 2012-10-22 06:19:32 +0000 | [diff] [blame] | 82 | *(.data*) |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | . = ALIGN(4); |
| 86 | |
| 87 | . = .; |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 88 | |
| 89 | . = ALIGN(4); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 90 | .u_boot_list : { |
Albert ARIBAUD | c24895e | 2013-02-25 00:59:00 +0000 | [diff] [blame] | 91 | KEEP(*(SORT(.u_boot_list*))); |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | . = ALIGN(4); |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 95 | |
Alexander Graf | 0bd425a | 2016-03-04 01:10:01 +0100 | [diff] [blame] | 96 | .__efi_runtime_start : { |
| 97 | *(.__efi_runtime_start) |
| 98 | } |
| 99 | |
| 100 | .efi_runtime : { |
| 101 | *(efi_runtime_text) |
| 102 | *(efi_runtime_data) |
| 103 | } |
| 104 | |
| 105 | .__efi_runtime_stop : { |
| 106 | *(.__efi_runtime_stop) |
| 107 | } |
| 108 | |
| 109 | .efi_runtime_rel_start : |
| 110 | { |
| 111 | *(.__efi_runtime_rel_start) |
| 112 | } |
| 113 | |
| 114 | .efi_runtime_rel : { |
| 115 | *(.relefi_runtime_text) |
| 116 | *(.relefi_runtime_data) |
| 117 | } |
| 118 | |
| 119 | .efi_runtime_rel_stop : |
| 120 | { |
| 121 | *(.__efi_runtime_rel_stop) |
| 122 | } |
| 123 | |
| 124 | . = ALIGN(4); |
| 125 | |
Albert ARIBAUD | c53687e | 2013-06-11 14:17:33 +0200 | [diff] [blame] | 126 | .image_copy_end : |
| 127 | { |
| 128 | *(.__image_copy_end) |
| 129 | } |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 130 | |
Albert ARIBAUD | af3ff16 | 2013-06-11 14:17:34 +0200 | [diff] [blame] | 131 | .rel_dyn_start : |
| 132 | { |
| 133 | *(.__rel_dyn_start) |
| 134 | } |
| 135 | |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 136 | .rel.dyn : { |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 137 | *(.rel*) |
Albert ARIBAUD | af3ff16 | 2013-06-11 14:17:34 +0200 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | .rel_dyn_end : |
| 141 | { |
| 142 | *(.__rel_dyn_end) |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 143 | } |
| 144 | |
Albert ARIBAUD | 9d25fa4 | 2014-02-22 17:53:42 +0100 | [diff] [blame] | 145 | .end : |
| 146 | { |
| 147 | *(.__end) |
| 148 | } |
| 149 | |
| 150 | _image_binary_end = .; |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 151 | |
| 152 | /* |
| 153 | * Deprecated: this MMU section is used by pxa at present but |
| 154 | * should not be used by new boards/CPUs. |
| 155 | */ |
| 156 | . = ALIGN(4096); |
| 157 | .mmutable : { |
| 158 | *(.mmutable) |
| 159 | } |
| 160 | |
Albert ARIBAUD | ba5662d | 2013-04-11 05:43:21 +0000 | [diff] [blame] | 161 | /* |
| 162 | * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c |
| 163 | * __bss_base and __bss_limit are for linker only (overlay ordering) |
| 164 | */ |
| 165 | |
Albert ARIBAUD | 436f632 | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 166 | .bss_start __rel_dyn_start (OVERLAY) : { |
| 167 | KEEP(*(.__bss_start)); |
Albert ARIBAUD | ba5662d | 2013-04-11 05:43:21 +0000 | [diff] [blame] | 168 | __bss_base = .; |
Albert ARIBAUD | 436f632 | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 169 | } |
| 170 | |
Albert ARIBAUD | ba5662d | 2013-04-11 05:43:21 +0000 | [diff] [blame] | 171 | .bss __bss_base (OVERLAY) : { |
Stephen Warren | adddf45 | 2012-10-22 06:19:32 +0000 | [diff] [blame] | 172 | *(.bss*) |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 173 | . = ALIGN(4); |
Albert ARIBAUD | ba5662d | 2013-04-11 05:43:21 +0000 | [diff] [blame] | 174 | __bss_limit = .; |
Albert ARIBAUD | 436f632 | 2013-02-25 00:58:59 +0000 | [diff] [blame] | 175 | } |
Tom Rini | 19aac97 | 2013-03-18 12:31:00 -0400 | [diff] [blame] | 176 | |
Albert ARIBAUD | ba5662d | 2013-04-11 05:43:21 +0000 | [diff] [blame] | 177 | .bss_end __bss_limit (OVERLAY) : { |
| 178 | KEEP(*(.__bss_end)); |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 179 | } |
| 180 | |
Albert ARIBAUD | 9d25fa4 | 2014-02-22 17:53:42 +0100 | [diff] [blame] | 181 | .dynsym _image_binary_end : { *(.dynsym) } |
Albert ARIBAUD | 95fc6d6 | 2013-11-07 14:21:46 +0100 | [diff] [blame] | 182 | .dynbss : { *(.dynbss) } |
| 183 | .dynstr : { *(.dynstr*) } |
| 184 | .dynamic : { *(.dynamic*) } |
| 185 | .plt : { *(.plt*) } |
| 186 | .interp : { *(.interp*) } |
Andreas Färber | 438a167 | 2014-01-27 05:48:11 +0100 | [diff] [blame] | 187 | .gnu.hash : { *(.gnu.hash) } |
Albert ARIBAUD | 95fc6d6 | 2013-11-07 14:21:46 +0100 | [diff] [blame] | 188 | .gnu : { *(.gnu*) } |
| 189 | .ARM.exidx : { *(.ARM.exidx*) } |
Albert ARIBAUD | ddadbed | 2014-01-13 14:57:05 +0100 | [diff] [blame] | 190 | .gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } |
Simon Glass | 437e2b8 | 2012-02-23 03:28:41 +0000 | [diff] [blame] | 191 | } |