Andre Przywara | 6228e43 | 2020-09-16 17:13:33 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2020, ARM Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | * Linker script for the Arm Ltd. FPGA boards to generate an ELF file that |
| 7 | * contains the ROM trampoline, BL31 and the DTB. |
| 8 | * |
| 9 | * This allows to pass just one file to the uploader tool, and automatically |
| 10 | * provides the correct load addresses. |
| 11 | */ |
| 12 | |
| 13 | #include <platform_def.h> |
| 14 | |
| 15 | OUTPUT_FORMAT("elf64-littleaarch64") |
| 16 | OUTPUT_ARCH(aarch64) |
| 17 | |
| 18 | INPUT(./bl31/bl31.elf) |
| 19 | INPUT(./rom_trampoline.o) |
Andre Przywara | 8c6d92d | 2021-05-14 16:13:28 +0100 | [diff] [blame] | 20 | INPUT(./kernel_trampoline.o) |
Andre Przywara | 6228e43 | 2020-09-16 17:13:33 +0100 | [diff] [blame] | 21 | |
| 22 | TARGET(binary) |
| 23 | INPUT(./fdts/arm_fpga.dtb) |
| 24 | |
| 25 | ENTRY(_start) |
| 26 | |
| 27 | SECTIONS |
| 28 | { |
| 29 | .rom (0x0): { |
| 30 | *rom_trampoline.o(.text*) |
| 31 | KEEP(*(.rom)) |
| 32 | } |
| 33 | |
| 34 | .bl31 (BL31_BASE): { |
| 35 | ASSERT(. == ALIGN(PAGE_SIZE), "BL31_BASE is not page aligned"); |
| 36 | *bl31.elf(.text* .data* .rodata* ro* .bss*) |
Andre Przywara | 6228e43 | 2020-09-16 17:13:33 +0100 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | .dtb (FPGA_PRELOADED_DTB_BASE): { |
| 40 | ASSERT(. == ALIGN(8), "DTB address is not 8-byte aligned"); |
| 41 | *arm_fpga.dtb |
| 42 | } |
| 43 | |
Andre Przywara | 8c6d92d | 2021-05-14 16:13:28 +0100 | [diff] [blame] | 44 | .kern_tramp (PRELOADED_BL33_BASE): { |
| 45 | *kernel_trampoline.o(.text*) |
| 46 | KEEP(*(.kern_tramp)) |
| 47 | } |
| 48 | |
Andre Przywara | 4d8a6bb | 2021-08-20 16:23:23 +0100 | [diff] [blame] | 49 | /DISCARD/ : { *(stacks) } |
Andre Przywara | 6228e43 | 2020-09-16 17:13:33 +0100 | [diff] [blame] | 50 | /DISCARD/ : { *(.debug_*) } |
| 51 | /DISCARD/ : { *(.note*) } |
| 52 | /DISCARD/ : { *(.comment*) } |
| 53 | } |