Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / cpu / armv8 / u-boot.lds
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2013
4  * David Feng <fenghua@phytium.com.cn>
5  *
6  * (C) Copyright 2002
7  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
8  */
9
10 #include <config.h>
11 #include <asm/psci.h>
12
13 OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
14 OUTPUT_ARCH(aarch64)
15 ENTRY(_start)
16 SECTIONS
17 {
18 #ifdef CONFIG_ARMV8_SECURE_BASE
19         /DISCARD/ : { *(.rela._secure*) }
20 #endif
21         . = 0x00000000;
22
23         . = ALIGN(8);
24         .text :
25         {
26                 *(.__image_copy_start)
27                 CPUDIR/start.o (.text*)
28         }
29
30         /* This needs to come before *(.text*) */
31         .efi_runtime : {
32                 __efi_runtime_start = .;
33                 *(.text.efi_runtime*)
34                 *(.rodata.efi_runtime*)
35                 *(.data.efi_runtime*)
36                 __efi_runtime_stop = .;
37         }
38
39         .text_rest :
40         {
41                 *(.text*)
42         }
43
44 #ifdef CONFIG_ARMV8_PSCI
45         .__secure_start :
46 #ifndef CONFIG_ARMV8_SECURE_BASE
47                 ALIGN(CONSTANT(COMMONPAGESIZE))
48 #endif
49         {
50                 KEEP(*(.__secure_start))
51         }
52
53 #ifndef CONFIG_ARMV8_SECURE_BASE
54 #define CONFIG_ARMV8_SECURE_BASE
55 #define __ARMV8_PSCI_STACK_IN_RAM
56 #endif
57         .secure_text CONFIG_ARMV8_SECURE_BASE :
58                 AT(ADDR(.__secure_start) + SIZEOF(.__secure_start))
59         {
60                 *(._secure.text)
61                 . = ALIGN(8);
62                 __secure_svc_tbl_start = .;
63                 KEEP(*(._secure_svc_tbl_entries))
64                 __secure_svc_tbl_end = .;
65         }
66
67         .secure_data : AT(LOADADDR(.secure_text) + SIZEOF(.secure_text))
68         {
69                 *(._secure.data)
70         }
71
72         .secure_stack ALIGN(ADDR(.secure_data) + SIZEOF(.secure_data),
73                             CONSTANT(COMMONPAGESIZE)) (NOLOAD) :
74 #ifdef __ARMV8_PSCI_STACK_IN_RAM
75                 AT(ADDR(.secure_stack))
76 #else
77                 AT(LOADADDR(.secure_data) + SIZEOF(.secure_data))
78 #endif
79         {
80                 KEEP(*(.__secure_stack_start))
81
82                 . = . + CONFIG_ARMV8_PSCI_NR_CPUS * ARM_PSCI_STACK_SIZE;
83
84                 . = ALIGN(CONSTANT(COMMONPAGESIZE));
85
86                 KEEP(*(.__secure_stack_end))
87         }
88
89 #ifndef __ARMV8_PSCI_STACK_IN_RAM
90         . = LOADADDR(.secure_stack);
91 #endif
92
93         .__secure_end : AT(ADDR(.__secure_end)) {
94                 KEEP(*(.__secure_end))
95                 LONG(0x1d1071c);        /* Must output something to reset LMA */
96         }
97 #endif
98
99         . = ALIGN(8);
100         .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
101
102         . = ALIGN(8);
103         .data : {
104                 *(.data*)
105         }
106
107         . = ALIGN(8);
108
109         . = .;
110
111         . = ALIGN(8);
112         .u_boot_list : {
113                 KEEP(*(SORT(.u_boot_list*)));
114         }
115
116         . = ALIGN(8);
117
118         .efi_runtime_rel : {
119                 __efi_runtime_rel_start = .;
120                 *(.rel*.efi_runtime)
121                 *(.rel*.efi_runtime.*)
122                 __efi_runtime_rel_stop = .;
123         }
124
125         . = ALIGN(8);
126
127         .image_copy_end :
128         {
129                 *(.__image_copy_end)
130         }
131
132         . = ALIGN(8);
133
134         .rel_dyn_start :
135         {
136                 *(.__rel_dyn_start)
137         }
138
139         .rela.dyn : {
140                 *(.rela*)
141         }
142
143         .rel_dyn_end :
144         {
145                 *(.__rel_dyn_end)
146         }
147
148         _end = .;
149
150         . = ALIGN(8);
151
152         .bss_start : {
153                 KEEP(*(.__bss_start));
154         }
155
156         .bss : {
157                 *(.bss*)
158                  . = ALIGN(8);
159         }
160
161         .bss_end : {
162                 KEEP(*(.__bss_end));
163         }
164
165         /DISCARD/ : { *(.dynsym) }
166         /DISCARD/ : { *(.dynstr*) }
167         /DISCARD/ : { *(.dynamic*) }
168         /DISCARD/ : { *(.plt*) }
169         /DISCARD/ : { *(.interp*) }
170         /DISCARD/ : { *(.gnu*) }
171
172 #ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
173 #include "linux-kernel-image-header-vars.h"
174 #endif
175 }