summaryrefslogtreecommitdiffstats
path: root/services/std_svc/rmmd/trp/linker.lds
blob: 2b7f38333def79e6fc155131e5261eed129ffdeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * (C) COPYRIGHT 2021 Arm Limited or its affiliates.
 * ALL RIGHTS RESERVED
 */

#include <common/bl_common.ld.h>
#include <lib/xlat_tables/xlat_tables_defs.h>

/* Mapped using 4K pages, requires us to align different sections with
 * different property at the same granularity. */
PAGE_SIZE_4K = 4096;

OUTPUT_FORMAT("elf64-littleaarch64")
OUTPUT_ARCH(aarch64)
ENTRY(trp_head)

MEMORY {
	RAM (rwx): ORIGIN = RMM_BASE, LENGTH = RMM_LIMIT - RMM_BASE
}


SECTIONS
{
	. = RMM_BASE;

	.text : {
		*(.head.text)
		. = ALIGN(8);
		*(.text*)
	} >RAM

	. = ALIGN(PAGE_SIZE_4K);

	.rodata : {
		*(.rodata*)
	} >RAM

	. = ALIGN(PAGE_SIZE_4K);

	 __RW_START__ = . ;

	.data : {
		*(.data*)
	} >RAM

	.bss (NOLOAD) : {
		__BSS_START__ = .;
		*(.bss*)
		__BSS_END__ = .;
	} >RAM
	__BSS_SIZE__ = SIZEOF(.bss);


	STACK_SECTION >RAM


	/*
	* Define a linker symbol to mark the end of the RW memory area for this
	* image.
	*/
	__RW_END__ = .;
	__RMM_END__ = .;


	/DISCARD/ : { *(.dynstr*) }
	/DISCARD/ : { *(.dynamic*) }
	/DISCARD/ : { *(.plt*) }
	/DISCARD/ : { *(.interp*) }
	/DISCARD/ : { *(.gnu*) }
	/DISCARD/ : { *(.note*) }
}