Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2013 |
| 4 | * David Feng <fenghua@phytium.com.cn> |
| 5 | * |
| 6 | * (C) Copyright 2002 |
| 7 | * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de> |
| 8 | * |
| 9 | * (C) Copyright 2010 |
| 10 | * Texas Instruments, <www.ti.com> |
| 11 | * Aneesh V <aneesh@ti.com> |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 12 | */ |
| 13 | |
Tom Rini | 2aaa27d | 2019-01-22 17:09:26 -0500 | [diff] [blame] | 14 | MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE, |
| 15 | LENGTH = IMAGE_MAX_SIZE } |
Simon Glass | 699f8a0 | 2024-09-20 09:24:33 +0200 | [diff] [blame^] | 16 | #ifdef CONFIG_SPL_SEPARATE_BSS |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 17 | MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, |
| 18 | LENGTH = CONFIG_SPL_BSS_MAX_SIZE } |
Simon Glass | 699f8a0 | 2024-09-20 09:24:33 +0200 | [diff] [blame^] | 19 | #endif |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 20 | |
| 21 | OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") |
| 22 | OUTPUT_ARCH(aarch64) |
| 23 | ENTRY(_start) |
| 24 | SECTIONS |
| 25 | { |
Ilias Apalodimas | cdb5839 | 2024-03-15 08:43:50 +0200 | [diff] [blame] | 26 | __image_copy_start = ADDR(.text); |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 27 | .text : { |
| 28 | . = ALIGN(8); |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 29 | CPUDIR/start.o (.text*) |
| 30 | *(.text*) |
| 31 | } >.sram |
| 32 | |
| 33 | .rodata : { |
| 34 | . = ALIGN(8); |
| 35 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
| 36 | } >.sram |
| 37 | |
| 38 | .data : { |
| 39 | . = ALIGN(8); |
| 40 | *(.data*) |
| 41 | } >.sram |
| 42 | |
Peng Fan | 617fc29 | 2020-05-05 20:28:41 +0800 | [diff] [blame] | 43 | #ifdef CONFIG_SPL_RECOVER_DATA_SECTION |
| 44 | .data_save : { |
| 45 | *(.__data_save_start) |
| 46 | . = SIZEOF(.data); |
| 47 | *(.__data_save_end) |
| 48 | } >.sram |
| 49 | #endif |
| 50 | |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 51 | __u_boot_list : { |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 52 | . = ALIGN(8); |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 53 | KEEP(*(SORT(__u_boot_list*))); |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 54 | } >.sram |
| 55 | |
Ilias Apalodimas | cdb5839 | 2024-03-15 08:43:50 +0200 | [diff] [blame] | 56 | . = ALIGN(8); |
| 57 | __image_copy_end = .; |
Ilias Apalodimas | 8080846 | 2024-05-28 09:18:27 +0300 | [diff] [blame] | 58 | _end = .; |
Masahiro Yamada | 9bcc571 | 2016-03-08 20:34:44 +0900 | [diff] [blame] | 59 | _image_binary_end = .; |
| 60 | |
Simon Glass | 699f8a0 | 2024-09-20 09:24:33 +0200 | [diff] [blame^] | 61 | #ifdef CONFIG_SPL_SEPARATE_BSS |
Ilias Apalodimas | 6d1e1b8 | 2024-03-15 08:43:46 +0200 | [diff] [blame] | 62 | .bss : { |
| 63 | __bss_start = .; |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 64 | *(.bss*) |
Ilias Apalodimas | 6d1e1b8 | 2024-03-15 08:43:46 +0200 | [diff] [blame] | 65 | . = ALIGN(8); |
| 66 | __bss_end = .; |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 67 | } >.sdram |
Simon Glass | 699f8a0 | 2024-09-20 09:24:33 +0200 | [diff] [blame^] | 68 | #else |
| 69 | .bss (NOLOAD) : { |
| 70 | __bss_start = .; |
| 71 | *(.bss*) |
| 72 | . = ALIGN(8); |
| 73 | __bss_end = .; |
| 74 | } >.sram |
| 75 | #endif |
| 76 | __bss_size = __bss_end - __bss_start; |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 77 | |
Marek BehĂșn | 57fd799 | 2021-05-20 13:24:20 +0200 | [diff] [blame] | 78 | /DISCARD/ : { *(.rela*) } |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 79 | /DISCARD/ : { *(.dynsym) } |
| 80 | /DISCARD/ : { *(.dynstr*) } |
| 81 | /DISCARD/ : { *(.dynamic*) } |
| 82 | /DISCARD/ : { *(.plt*) } |
| 83 | /DISCARD/ : { *(.interp*) } |
| 84 | /DISCARD/ : { *(.gnu*) } |
Alper Nebi Yasak | 463eb09 | 2022-01-29 18:27:03 +0300 | [diff] [blame] | 85 | |
| 86 | #ifdef CONFIG_LINUX_KERNEL_IMAGE_HEADER |
| 87 | #include "linux-kernel-image-header-vars.h" |
| 88 | #endif |
Scott Wood | 8e728cd | 2015-03-24 13:25:02 -0700 | [diff] [blame] | 89 | } |
Ilias Apalodimas | 6d1e1b8 | 2024-03-15 08:43:46 +0200 | [diff] [blame] | 90 | |
| 91 | ASSERT(ADDR(.bss) % 8 == 0, \ |
| 92 | ".bss must be 8-byte aligned"); |