blob: a247ee400b0e1df2879c63dd5ded8d71497b01d1 [file] [log] [blame]
Antonio Nino Diaz0b1ab402018-12-05 15:38:39 +00001/*
Ruari Phipps9f1952c2020-08-24 11:32:32 +01002 * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
Antonio Nino Diaz0b1ab402018-12-05 15:38:39 +00003 *
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
11OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
12OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
13ENTRY(ivy_entrypoint)
14
15SECTIONS
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 Phipps9f1952c2020-08-24 11:32:32 +010035 /*
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 Diaz0b1ab402018-12-05 15:38:39 +000045 . = 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 Phipps9f1952c2020-08-24 11:32:32 +010057 /*
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 Diaz0b1ab402018-12-05 15:38:39 +000069 .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}