blob: 958a1b70aefe95b18927743a0c327aa9aa91e905 [file] [log] [blame]
Kever Yang87ce4bc2019-04-01 17:15:53 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * (C) Copyright 2019
4 * Rockchip Electronics Co., Ltd
5 * Kever Yang<kever.yang@rock-chips.com>
6 *
7 * (C) Copyright 2013
8 * David Feng <fenghua@phytium.com.cn>
9 *
10 * (C) Copyright 2002
11 * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
12 *
13 * (C) Copyright 2010
14 * Texas Instruments, <www.ti.com>
15 * Aneesh V <aneesh@ti.com>
16 */
17
18OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
19OUTPUT_ARCH(aarch64)
20ENTRY(_start)
21SECTIONS
22{
23 . = 0x00000000;
24
Ilias Apalodimascdb58392024-03-15 08:43:50 +020025 __image_copy_start = ADDR(.text);
Kever Yang87ce4bc2019-04-01 17:15:53 +080026 .text : {
27 . = ALIGN(8);
Kever Yang87ce4bc2019-04-01 17:15:53 +080028 CPUDIR/start.o (.text*)
29 *(.text*)
30 }
31
32 .rodata : {
33 . = ALIGN(8);
34 *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
35 }
36
37 .data : {
38 . = ALIGN(8);
39 *(.data*)
40 }
41
Andrew Scull5a9095c2022-05-30 10:00:04 +000042 __u_boot_list : {
Kever Yang87ce4bc2019-04-01 17:15:53 +080043 . = ALIGN(8);
Andrew Scull5a9095c2022-05-30 10:00:04 +000044 KEEP(*(SORT(__u_boot_list*)));
Kever Yang87ce4bc2019-04-01 17:15:53 +080045 }
46
Ilias Apalodimascdb58392024-03-15 08:43:50 +020047 . = ALIGN(8);
48 __image_copy_end = .;
Ilias Apalodimas80808462024-05-28 09:18:27 +030049 _end = .;
Kever Yang87ce4bc2019-04-01 17:15:53 +080050 _image_binary_end = .;
51
Ilias Apalodimas6d1e1b82024-03-15 08:43:46 +020052 .bss ALIGN(8) : {
53 __bss_start = .;
Kever Yang87ce4bc2019-04-01 17:15:53 +080054 *(.bss*)
Ilias Apalodimas6d1e1b82024-03-15 08:43:46 +020055 . = ALIGN(8);
56 __bss_end = .;
Kever Yang87ce4bc2019-04-01 17:15:53 +080057 }
58
59 /DISCARD/ : { *(.dynsym) }
60 /DISCARD/ : { *(.dynstr*) }
61 /DISCARD/ : { *(.dynamic*) }
62 /DISCARD/ : { *(.plt*) }
63 /DISCARD/ : { *(.interp*) }
64 /DISCARD/ : { *(.gnu*) }
65}
66
67#if defined(CONFIG_TPL_MAX_SIZE)
68ASSERT(__image_copy_end - __image_copy_start < (CONFIG_TPL_MAX_SIZE), \
69 "TPL image too big");
70#endif
71
72#if defined(CONFIG_TPL_BSS_MAX_SIZE)
73ASSERT(__bss_end - __bss_start < (CONFIG_TPL_BSS_MAX_SIZE), \
74 "TPL image BSS too big");
75#endif
76
77#if defined(CONFIG_TPL_MAX_FOOTPRINT)
78ASSERT(__bss_end - _start < (CONFIG_TPL_MAX_FOOTPRINT), \
79 "TPL image plus BSS too big");
80#endif