Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 1 | /* |
Daniel Boulby | f3da591 | 2022-04-01 12:31:52 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2022, Arm Limited. All rights reserved. |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
Daniel Boulby | f3da591 | 2022-04-01 12:31:52 +0100 | [diff] [blame] | 7 | #include <sp_def.h> |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 8 | #include <platform_def.h> |
| 9 | #include <xlat_tables_defs.h> |
| 10 | |
| 11 | OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT) |
| 12 | OUTPUT_ARCH(PLATFORM_LINKER_ARCH) |
| 13 | ENTRY(cactus_entrypoint) |
| 14 | |
| 15 | SECTIONS |
| 16 | { |
Daniel Boulby | f3da591 | 2022-04-01 12:31:52 +0100 | [diff] [blame] | 17 | . = SP_IMAGE_BASE; |
Antonio Nino Diaz | 4762fef | 2018-06-29 14:58:04 +0100 | [diff] [blame] | 18 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 19 | ASSERT(. == ALIGN(PAGE_SIZE), |
| 20 | "TEXT_START address is not aligned to PAGE_SIZE.") |
| 21 | |
| 22 | .text : { |
| 23 | __TEXT_START__ = .; |
| 24 | *cactus_entrypoint.o(.text*) |
| 25 | *(.text*) |
| 26 | *(.vectors) |
| 27 | . = NEXT(PAGE_SIZE); |
| 28 | __TEXT_END__ = .; |
| 29 | } |
| 30 | |
| 31 | .rodata : { |
| 32 | . = ALIGN(PAGE_SIZE); |
| 33 | __RODATA_START__ = .; |
| 34 | *(.rodata*) |
Olivier Deprez | 1d2b88d | 2020-03-06 17:17:56 +0100 | [diff] [blame] | 35 | |
| 36 | /* |
| 37 | * Keep the .got section in the RO section as it is patched |
| 38 | * prior to enabling the MMU and having the .got in RO is better for |
| 39 | * security. GOT is a table of addresses so ensure 8-byte alignment. |
| 40 | */ |
| 41 | . = ALIGN(8); |
| 42 | __GOT_START__ = .; |
| 43 | *(.got) |
| 44 | __GOT_END__ = .; |
| 45 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 46 | . = NEXT(PAGE_SIZE); |
| 47 | __RODATA_END__ = .; |
Olivier Deprez | 1d2b88d | 2020-03-06 17:17:56 +0100 | [diff] [blame] | 48 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 49 | } |
| 50 | |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 51 | .data : { |
| 52 | . = ALIGN(PAGE_SIZE); |
Antonio Nino Diaz | 54287c8 | 2018-12-05 15:37:33 +0000 | [diff] [blame] | 53 | __DATA_START__ = .; |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 54 | *(.data*) |
J-Alves | 0e1e7ca | 2021-01-25 14:11:06 +0000 | [diff] [blame] | 55 | . = ALIGN(PAGE_SIZE); |
| 56 | cactus_cmd_handler_begin = .; |
| 57 | KEEP(*(.cactus_handler)) |
| 58 | cactus_cmd_handler_end = .; |
Antonio Nino Diaz | 54287c8 | 2018-12-05 15:37:33 +0000 | [diff] [blame] | 59 | . = NEXT(PAGE_SIZE); |
| 60 | __DATA_END__ = .; |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 61 | } |
| 62 | |
Olivier Deprez | 1d2b88d | 2020-03-06 17:17:56 +0100 | [diff] [blame] | 63 | /* |
| 64 | * .rela.dyn needs to come after .data for the read-elf utility to parse |
| 65 | * this section correctly. Ensure 8-byte alignment so that the fields of |
| 66 | * RELA data structure are aligned. |
| 67 | */ |
| 68 | . = ALIGN(8); |
| 69 | __RELA_START__ = .; |
| 70 | .rela.dyn . : { |
| 71 | } |
| 72 | __RELA_END__ = .; |
| 73 | |
Antonio Nino Diaz | 54287c8 | 2018-12-05 15:37:33 +0000 | [diff] [blame] | 74 | .bss (NOLOAD) : { |
| 75 | . = ALIGN(PAGE_SIZE); |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 76 | __BSS_START__ = .; |
| 77 | *(SORT_BY_ALIGNMENT(.bss*)) |
| 78 | *(COMMON) |
J-Alves | 63cdaa7 | 2020-10-08 17:22:45 +0100 | [diff] [blame] | 79 | *(xlat_table*) |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 80 | . = NEXT(PAGE_SIZE); |
| 81 | __BSS_END__ = .; |
Sandrine Bailleux | 3cd87d7 | 2018-10-09 11:12:55 +0200 | [diff] [blame] | 82 | } |
| 83 | } |