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 * (C) Copyright 2010
10 * Texas Instruments, <www.ti.com>
11 *	Aneesh V <aneesh@ti.com>
12 */
13
14MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,
15		LENGTH = IMAGE_MAX_SIZE }
16#ifdef CONFIG_SPL_SEPARATE_BSS
17MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
18		LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
19#endif
20
21OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
22OUTPUT_ARCH(aarch64)
23ENTRY(_start)
24SECTIONS
25{
26	__image_copy_start = ADDR(.text);
27	.text : {
28		. = ALIGN(8);
29		CPUDIR/start.o (.text*)
30		*(.text*)
31	} >.sram
32
33	.rodata : {
34		. = ALIGN(8);
35		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
36	} >.sram
37
38	.data : {
39		. = ALIGN(8);
40		*(.__data_start)
41		*(.data*)
42	} >.sram
43
44#ifdef CONFIG_SPL_RECOVER_DATA_SECTION
45	.data_save : {
46		*(.__data_save_start)
47		. = SIZEOF(.data);
48		*(.__data_save_end)
49	} >.sram
50#endif
51
52	__u_boot_list : {
53		. = ALIGN(8);
54		KEEP(*(SORT(__u_boot_list*)));
55	} >.sram
56
57	. = ALIGN(8);
58	__image_copy_end = .;
59	_end = .;
60	_image_binary_end = .;
61
62#ifdef CONFIG_SPL_SEPARATE_BSS
63	.bss : {
64		__bss_start = .;
65		*(.bss*)
66		. = ALIGN(8);
67		__bss_end = .;
68	} >.sdram
69#else
70	.bss (NOLOAD) : {
71		__bss_start = .;
72		*(.bss*)
73		 . = ALIGN(8);
74		__bss_end = .;
75	} >.sram
76#endif
77	__bss_size = __bss_end - __bss_start;
78
79	/DISCARD/ : { *(.rela*) }
80	/DISCARD/ : { *(.dynsym) }
81	/DISCARD/ : { *(.dynstr*) }
82	/DISCARD/ : { *(.dynamic*) }
83	/DISCARD/ : { *(.plt*) }
84	/DISCARD/ : { *(.interp*) }
85	/DISCARD/ : { *(.gnu*) }
86
87#ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
88#include "linux-kernel-image-header-vars.h"
89#endif
90}
91
92ASSERT(ADDR(.bss) % 8 == 0, \
93       ".bss must be 8-byte aligned");
94