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); |
| 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 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 | |
| 64 | .end : |
| 65 | { |
| 66 | *(.__end) |
| 67 | } > .nor |
| 68 | |
| 69 | _image_binary_end = .; |
| 70 | |
Joel Stanley | 6d01ad1 | 2022-06-29 16:35:24 +0930 | [diff] [blame] | 71 | .bss : { |
Chia-Wei Wang | c95afa3 | 2022-06-01 16:21:15 +0800 | [diff] [blame] | 72 | __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) |
| 82 | ASSERT(__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) |
| 87 | ASSERT(__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) |
| 92 | ASSERT(__bss_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \ |
| 93 | "SPL image plus BSS too big"); |
| 94 | #endif |