Antonio Nino Diaz | 0b1ab40 | 2018-12-05 15:38:39 +0000 | [diff] [blame] | 1 | /* |
Ruari Phipps | 9f1952c | 2020-08-24 11:32:32 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2018-2021, Arm Limited. All rights reserved. |
Antonio Nino Diaz | 0b1ab40 | 2018-12-05 15:38:39 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <ivy_def.h> |
| 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(ivy_entrypoint) |
| 14 | |
| 15 | SECTIONS |
| 16 | { |
| 17 | . = IVY_IMAGE_BASE; |
| 18 | |
| 19 | ASSERT(. == ALIGN(PAGE_SIZE), |
| 20 | "TEXT_START address is not aligned to PAGE_SIZE.") |
| 21 | |
| 22 | .text : { |
| 23 | __TEXT_START__ = .; |
| 24 | *ivy_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*) |
Ruari Phipps | 9f1952c | 2020-08-24 11:32:32 +0100 | [diff] [blame^] | 35 | /* |
| 36 | * Keep the .got section in the RO section as it is patched |
| 37 | * prior to enabling the MMU, so having it in RO is better for |
| 38 | * security. GOT is a table of addresses so ensure 8-byte alignment. |
| 39 | */ |
| 40 | . = ALIGN(8); |
| 41 | __GOT_START__ = .; |
| 42 | *(.got) |
| 43 | __GOT_END__ = .; |
| 44 | |
Antonio Nino Diaz | 0b1ab40 | 2018-12-05 15:38:39 +0000 | [diff] [blame] | 45 | . = NEXT(PAGE_SIZE); |
| 46 | __RODATA_END__ = .; |
| 47 | } |
| 48 | |
| 49 | .data : { |
| 50 | . = ALIGN(PAGE_SIZE); |
| 51 | __DATA_START__ = .; |
| 52 | *(.data*) |
| 53 | . = NEXT(PAGE_SIZE); |
| 54 | __DATA_END__ = .; |
| 55 | } |
| 56 | |
Ruari Phipps | 9f1952c | 2020-08-24 11:32:32 +0100 | [diff] [blame^] | 57 | /* |
| 58 | * .rela.dyn needs to come after .data for the read-elf utility |
| 59 | * to parse this section correctly. Ensure 8-byte alignment so |
| 60 | * that the fields of RELA data structure are aligned. |
| 61 | */ |
| 62 | . = ALIGN(8); |
| 63 | __RELA_START__ = .; |
| 64 | .rela.dyn . : { |
| 65 | } |
| 66 | __RELA_END__ = .; |
| 67 | |
| 68 | |
Antonio Nino Diaz | 0b1ab40 | 2018-12-05 15:38:39 +0000 | [diff] [blame] | 69 | .bss (NOLOAD) : { |
| 70 | . = ALIGN(PAGE_SIZE); |
| 71 | __BSS_START__ = .; |
| 72 | *(SORT_BY_ALIGNMENT(.bss*)) |
| 73 | *(COMMON) |
| 74 | . = NEXT(PAGE_SIZE); |
| 75 | __BSS_END__ = .; |
| 76 | } |
| 77 | } |