blob: fed69644b5534fe939b5763150d2e9ff5c8037e2 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Scott Wood8e728cd2015-03-24 13:25:02 -07002/*
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>
Scott Wood8e728cd2015-03-24 13:25:02 -070012 */
13
Tom Rini2aaa27d2019-01-22 17:09:26 -050014MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,
15 LENGTH = IMAGE_MAX_SIZE }
Simon Glass699f8a02024-09-20 09:24:33 +020016#ifdef CONFIG_SPL_SEPARATE_BSS
Scott Wood8e728cd2015-03-24 13:25:02 -070017MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
18 LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
Simon Glass699f8a02024-09-20 09:24:33 +020019#endif
Scott Wood8e728cd2015-03-24 13:25:02 -070020
21OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
22OUTPUT_ARCH(aarch64)
23ENTRY(_start)
24SECTIONS
25{
Ilias Apalodimascdb58392024-03-15 08:43:50 +020026 __image_copy_start = ADDR(.text);
Scott Wood8e728cd2015-03-24 13:25:02 -070027 .text : {
28 . = ALIGN(8);
Scott Wood8e728cd2015-03-24 13:25:02 -070029 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*)
41 } >.sram
42
Peng Fan617fc292020-05-05 20:28:41 +080043#ifdef CONFIG_SPL_RECOVER_DATA_SECTION
44 .data_save : {
45 *(.__data_save_start)
46 . = SIZEOF(.data);
47 *(.__data_save_end)
48 } >.sram
49#endif
50
Andrew Scull5a9095c2022-05-30 10:00:04 +000051 __u_boot_list : {
Scott Wood8e728cd2015-03-24 13:25:02 -070052 . = ALIGN(8);
Andrew Scull5a9095c2022-05-30 10:00:04 +000053 KEEP(*(SORT(__u_boot_list*)));
Scott Wood8e728cd2015-03-24 13:25:02 -070054 } >.sram
55
Ilias Apalodimascdb58392024-03-15 08:43:50 +020056 . = ALIGN(8);
57 __image_copy_end = .;
Ilias Apalodimas80808462024-05-28 09:18:27 +030058 _end = .;
Masahiro Yamada9bcc5712016-03-08 20:34:44 +090059 _image_binary_end = .;
60
Simon Glass699f8a02024-09-20 09:24:33 +020061#ifdef CONFIG_SPL_SEPARATE_BSS
Ilias Apalodimas6d1e1b82024-03-15 08:43:46 +020062 .bss : {
63 __bss_start = .;
Scott Wood8e728cd2015-03-24 13:25:02 -070064 *(.bss*)
Ilias Apalodimas6d1e1b82024-03-15 08:43:46 +020065 . = ALIGN(8);
66 __bss_end = .;
Scott Wood8e728cd2015-03-24 13:25:02 -070067 } >.sdram
Simon Glass699f8a02024-09-20 09:24:33 +020068#else
69 .bss (NOLOAD) : {
70 __bss_start = .;
71 *(.bss*)
72 . = ALIGN(8);
73 __bss_end = .;
74 } >.sram
75#endif
76 __bss_size = __bss_end - __bss_start;
Scott Wood8e728cd2015-03-24 13:25:02 -070077
Marek BehĂșn57fd7992021-05-20 13:24:20 +020078 /DISCARD/ : { *(.rela*) }
Scott Wood8e728cd2015-03-24 13:25:02 -070079 /DISCARD/ : { *(.dynsym) }
80 /DISCARD/ : { *(.dynstr*) }
81 /DISCARD/ : { *(.dynamic*) }
82 /DISCARD/ : { *(.plt*) }
83 /DISCARD/ : { *(.interp*) }
84 /DISCARD/ : { *(.gnu*) }
Alper Nebi Yasak463eb092022-01-29 18:27:03 +030085
86#ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER
87#include "linux-kernel-image-header-vars.h"
88#endif
Scott Wood8e728cd2015-03-24 13:25:02 -070089}
Ilias Apalodimas6d1e1b82024-03-15 08:43:46 +020090
91ASSERT(ADDR(.bss) % 8 == 0, \
92 ".bss must be 8-byte aligned");