blob: 9502a7384b53b4e2260b63d41e70f0dfd0780a9e [file] [log] [blame]
Chia-Wei Wangc95afa32022-06-01 16:21:15 +08001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (c) 2004-2008 Texas Instruments
4 *
5 * (C) Copyright 2002
6 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
7 *
8 * (C) Copyright 2022
9 * Chia-Wei Wang <chiawei_wang@aspeedtech.com>
10 */
11
12MEMORY { .nor : ORIGIN = CONFIG_SPL_TEXT_BASE,
13 LENGTH = CONFIG_SPL_SIZE_LIMIT }
14MEMORY { .bss : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
15 LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
16
17OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
18OUTPUT_ARCH(arm)
19ENTRY(_start)
20SECTIONS
21{
22 . = 0x00000000;
23
24 . = ALIGN(4);
Ilias Apalodimascdb58392024-03-15 08:43:50 +020025 __image_copy_start = ADDR(.text);
Chia-Wei Wangc95afa32022-06-01 16:21:15 +080026 .text :
27 {
Chia-Wei Wangc95afa32022-06-01 16:21:15 +080028 *(.vectors)
29 CPUDIR/start.o (.text*)
30 *(.text*)
31 *(.glue*)
32 } > .nor
33
34 . = ALIGN(4);
35 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } > .nor
36
37 . = ALIGN(4);
38 .data : {
39 *(.data*)
40 } > .nor
41
42 . = ALIGN(4);
Joel Stanleyb449a2b2022-06-28 13:57:25 +093043 __u_boot_list : {
44 KEEP(*(SORT(__u_boot_list*)));
Chia-Wei Wangc95afa32022-06-01 16:21:15 +080045 } > .nor
46
47 . = ALIGN(4);
48 .binman_sym_table : {
49 __binman_sym_start = .;
50 KEEP(*(SORT(.binman_sym*)));
51 __binman_sym_end = .;
52 } > .nor
53
54 . = ALIGN(4);
55
56 __image_copy_end = .;
57
58 .rel.dyn : {
59 __rel_dyn_start = .;
60 *(.rel*)
61 __rel_dyn_end = .;
62 } > .nor
63
Ilias Apalodimas80808462024-05-28 09:18:27 +030064 _end = .;
Chia-Wei Wangc95afa32022-06-01 16:21:15 +080065 _image_binary_end = .;
66
Joel Stanley6d01ad12022-06-29 16:35:24 +093067 .bss : {
Chia-Wei Wangc95afa32022-06-01 16:21:15 +080068 __bss_start = .;
69 *(.bss*)
70 . = ALIGN(4);
71 __bss_end = .;
72 } > .bss
73
74 __bss_size = __bss_end - __bss_start;
75}
76
77#if defined(IMAGE_MAX_SIZE)
78ASSERT(__image_copy_end - __image_copy_start <= (IMAGE_MAX_SIZE), \
79 "SPL image too big");
80#endif
81
82#if defined(CONFIG_SPL_BSS_MAX_SIZE)
83ASSERT(__bss_end - __bss_start <= (CONFIG_SPL_BSS_MAX_SIZE), \
84 "SPL image BSS too big");
85#endif
86
87#if defined(CONFIG_SPL_MAX_FOOTPRINT)
88ASSERT(__bss_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \
89 "SPL image plus BSS too big");
90#endif