summaryrefslogtreecommitdiff
path: root/bsp/synopsys/boards/linker_template_mw.ld
blob: 248dc5ac4caa7c8efbd10ed762c4247e979ce387 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#define __ASSEMBLY__
#include <target_mem_config.h>

MEMORY {
#if (REGION_ICCM_SIZE != 0)
	REGION_ICCM :		ORIGIN = REGION_ICCM_START,	LENGTH = REGION_ICCM_SIZE
#endif
#if (REGION_DCCM_SIZE !=0)
	REGION_DCCM :		ORIGIN = REGION_DCCM_START,	LENGTH = REGION_DCCM_SIZE
#endif
#if (REGION_XCCM_SIZE != 0)
	REGION_XCCM :		ORIGIN = REGION_XCCM_START,	LENGTH = REGION_XCCM_SIZE
#endif
#if (REGION_YCCM_SIZE != 0)
	REGION_YCCM :		ORIGIN = REGION_YCCM_START,	LENGTH = REGION_YCCM_SIZE
#endif
#if (REGION_EXT_ROM_SIZE != 0)
	REGION_EXT_ROM :	ORIGIN = REGION_EXT_ROM_START,	LENGTH = REGION_EXT_ROM_SIZE
#endif
#if (REGION_EXT_RAM_SIZE != 0)
	REGION_EXT_RAM :	ORIGIN = REGION_EXT_RAM_START,	LENGTH = REGION_EXT_RAM_SIZE
#endif
}

ENTRY(_start)

SECTIONS {

	GROUP : {
		.image_head: {
			. = . + IMAGE_HEAD_SIZE;
		}
		.init_bootstrap:{
			_f_init = .;
			*(.init_vector .init_vector.*)
			*(.init_bootstrap .init_bootstrap.*)
			_e_init = .;
		}
		.vector ALIGN(1024): {
			_f_vector = .;
			*(.vector .vector.*)
			_e_vector = .;
		}
	} > REGION_ROM

#if (REGION_XCCM_SIZE != 0)
	GROUP (NOLOAD): {
		.x_ccm ALIGN(8): {
			_f_x_ccm = .;
			*(.x_ccm)
			*(.x_ccm.*)
			_e_x_ccm = .;
		}
	} > REGION_XCCM
#endif

#if (REGION_YCCM_SIZE != 0)
	GROUP (NOLOAD): {
		.y_ccm ALIGN(8): {
			_f_y_ccm = .;
			*(.y_ccm)
			*(.y_ccm.*)
			_e_y_ccm = .;
		}
	} > REGION_YCCM
#endif

	GROUP : {

		.text ALIGN(4): {
			_f_text = .;
			*(TYPE text)
			*(.text*)
			_e_text = .;
		}

		.rodata  ALIGN(4): {
			_f_rodata = .;

			_fctors = .;
			*(.ctors*)
			_ectors = .;
			_fdtors = .;
			*(.dtors*)
			_edtors = .;
			_feh_frame = .;
			*(.eh_frame*)
			_eeh_frame = .;

			*(TYPE lit)

			/* section information for finsh shell */
			. = ALIGN(4);
			__fsymtab_start = .;
			*(FSymTab*)
			__fsymtab_end = .;
			. = ALIGN(4);
			__vsymtab_start = .;
			*(VSymTab*)
			__vsymtab_end = .;

			. = ALIGN(4);
			__rt_init_start = .;
			*(.rti_fn*)
			__rt_init_end = .;
			. = ALIGN(4);

			_e_rodata = .;
		}

	} > REGION_ROM


	GROUP : {
		.data ALIGN(8): {
			_f_data = .;
			_f_sdata = .;
			*(.sdata)
			*(.sbss)
			_e_sdata = .;
			*(TYPE data)
		}
#if defined(EMBARC_UNIT_TEST)
		.unit_test ALIGN(8): {
			_f_embarc_unittest = .;
			KEEP(*(".embarc_unittest"))
			_e_embarc_unittest = .;
		}
#endif
		.tls ALIGN(8): {
			*(.tls*)
			_e_data = .;
		}
	} > REGION_RAM AT > REGION_ROM

	GROUP (NOLOAD) : {
		.bss ALIGN(8): {
			_f_bss = .;
			*(TYPE bss)
			_e_bss = .;
		}
		.stack ALIGN(4) SIZE(_STACKSIZE): {}
		.heap? ALIGN(4) SIZE(_HEAPSIZE): {}
	} > REGION_RAM

	_f_stack = ADDR(.stack);
	_e_stack = ADDR(.stack) + SIZEOF(.stack);
	_f_heap = ADDR(.heap);
	_e_heap = ADDR(.heap) + SIZEOF(.heap);

	_load_addr_text = LOADADDR(.text);
	_load_addr_rodata = LOADADDR(.rodata);
	_load_addr_data = LOADADDR(.data);
}