blob: 8fe4682dd2aed64bc80d06122f5cb1f0ee00aeea [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
David Feng85fd5f12013-12-14 11:47:35 +08002/*
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>
David Feng85fd5f12013-12-14 11:47:35 +08008 */
9
macro.wave.z@gmail.com01bd3342016-12-08 11:58:22 +080010#include <config.h>
11#include <asm/psci.h>
12
David Feng85fd5f12013-12-14 11:47:35 +080013OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
14OUTPUT_ARCH(aarch64)
15ENTRY(_start)
16SECTIONS
17{
macro.wave.z@gmail.com01bd3342016-12-08 11:58:22 +080018#ifdef CONFIG_ARMV8_SECURE_BASE
19 /DISCARD/ : { *(.rela._secure*) }
20#endif
David Feng85fd5f12013-12-14 11:47:35 +080021 . = 0x00000000;
22
23 . = ALIGN(8);
24 .text :
25 {
26 *(.__image_copy_start)
27 CPUDIR/start.o (.text*)
Alexander Graf94a10f22018-06-12 07:48:37 +020028 }
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 {
David Feng85fd5f12013-12-14 11:47:35 +080041 *(.text*)
42 }
macro.wave.z@gmail.com01bd3342016-12-08 11:58:22 +080043
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)
Chee Hong Angfb140832019-02-12 00:27:02 -080061 . = ALIGN(8);
62 __secure_svc_tbl_start = .;
63 KEEP(*(._secure_svc_tbl_entries))
64 __secure_svc_tbl_end = .;
macro.wave.z@gmail.com01bd3342016-12-08 11:58:22 +080065 }
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
David Feng85fd5f12013-12-14 11:47:35 +080098
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);
Andrew Scull5a9095c2022-05-30 10:00:04 +0000112 __u_boot_list : {
113 KEEP(*(SORT(__u_boot_list*)));
David Feng85fd5f12013-12-14 11:47:35 +0800114 }
115
116 . = ALIGN(8);
117
Alexander Graf0bd425a2016-03-04 01:10:01 +0100118 .efi_runtime_rel : {
119 __efi_runtime_rel_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +0200120 *(.rel*.efi_runtime)
121 *(.rel*.efi_runtime.*)
Alexander Graf0bd425a2016-03-04 01:10:01 +0100122 __efi_runtime_rel_stop = .;
123 }
124
125 . = ALIGN(8);
126
David Feng85fd5f12013-12-14 11:47:35 +0800127 .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*) }
Stephen Warren80a93652018-01-03 14:31:51 -0700171
172#ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
173#include "linux-kernel-image-header-vars.h"
174#endif
David Feng85fd5f12013-12-14 11:47:35 +0800175}