blob: 95a509ba3f318ecefd511f4ea1326848a0d96f7d [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);
25 .text :
26 {
27 __image_copy_start = .;
28 *(.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
64 .end :
65 {
66 *(.__end)
67 } > .nor
68
69 _image_binary_end = .;
70
Joel Stanleyb449a2b2022-06-28 13:57:25 +093071 .bss __rel_dyn_start (OVERLAY) : {
Chia-Wei Wangc95afa32022-06-01 16:21:15 +080072 __bss_start = .;
73 *(.bss*)
74 . = ALIGN(4);
75 __bss_end = .;
76 } > .bss
77
78 __bss_size = __bss_end - __bss_start;
79}
80
81#if defined(IMAGE_MAX_SIZE)
82ASSERT(__image_copy_end - __image_copy_start <= (IMAGE_MAX_SIZE), \
83 "SPL image too big");
84#endif
85
86#if defined(CONFIG_SPL_BSS_MAX_SIZE)
87ASSERT(__bss_end - __bss_start <= (CONFIG_SPL_BSS_MAX_SIZE), \
88 "SPL image BSS too big");
89#endif
90
91#if defined(CONFIG_SPL_MAX_FOOTPRINT)
92ASSERT(__bss_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \
93 "SPL image plus BSS too big");
94#endif