Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 1 | /* 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 | |
| 12 | MEMORY { .nor : ORIGIN = CONFIG_SPL_TEXT_BASE, |
| 13 | LENGTH = CONFIG_SPL_SIZE_LIMIT } |
| 14 | MEMORY { .bss : ORIGIN = CONFIG_SPL_BSS_START_ADDR, |
| 15 | LENGTH = CONFIG_SPL_BSS_MAX_SIZE } |
| 16 | |
| 17 | OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") |
| 18 | OUTPUT_ARCH(arm) |
| 19 | ENTRY(_start) |
| 20 | SECTIONS |
| 21 | { |
| 22 | . = 0x00000000; |
| 23 | |
| 24 | . = ALIGN(4); |
Ilias Apalodimas | cdb5839 | 2024-03-15 08:43:50 +0200 | [diff] [blame] | 25 | __image_copy_start = ADDR(.text); |
Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 26 | .text : |
| 27 | { |
Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 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 Stanley | b449a2b | 2022-06-28 13:57:25 +0930 | [diff] [blame] | 43 | __u_boot_list : { |
| 44 | KEEP(*(SORT(__u_boot_list*))); |
Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 45 | } > .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 Apalodimas | 8080846 | 2024-05-28 09:18:27 +0300 | [diff] [blame^] | 64 | _end = .; |
Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 65 | _image_binary_end = .; |
| 66 | |
Joel Stanley | 6d01ad1 | 2022-06-29 16:35:24 +0930 | [diff] [blame] | 67 | .bss : { |
Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 68 | __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) |
| 78 | ASSERT(__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) |
| 83 | ASSERT(__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) |
| 88 | ASSERT(__bss_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \ |
| 89 | "SPL image plus BSS too big"); |
| 90 | #endif |