Automatic date update in version.in
[deliverable/binutils-gdb.git] / ld / scripttempl / pru.sc
1 cat <<EOF
2 OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
3 OUTPUT_ARCH(${ARCH})
4
5 EOF
6
7 test -n "${RELOCATING}" && cat <<EOF
8 /* Allow memory sizes to be overridden from command line. */
9 __IMEM_SIZE = DEFINED(__IMEM_SIZE) ? __IMEM_SIZE : $TEXT_LENGTH;
10 __DMEM_SIZE = DEFINED(__DMEM_SIZE) ? __DMEM_SIZE : $DATA_LENGTH;
11
12 MEMORY
13 {
14 imem (x) : ORIGIN = $TEXT_ORIGIN, LENGTH = __IMEM_SIZE
15 dmem (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = __DMEM_SIZE
16 }
17
18 __HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32;
19 __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 512;
20
21 PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem));
22
23 ENTRY (_start)
24
25 EOF
26
27 cat <<EOF
28 SECTIONS
29 {
30 /* Read-only sections, merged into text segment: */
31 ${TEXT_DYNAMIC+${DYNAMIC}}
32 .hash ${RELOCATING-0} : { *(.hash) }
33 .dynsym ${RELOCATING-0} : { *(.dynsym) }
34 .dynstr ${RELOCATING-0} : { *(.dynstr) }
35 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
36 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
37 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
38
39 .rel.init ${RELOCATING-0} : { *(.rel.init) }
40 .rela.init ${RELOCATING-0} : { *(.rela.init) }
41 .rel.text ${RELOCATING-0} :
42 {
43 *(.rel.text)
44 ${RELOCATING+*(.rel.text.*)}
45 ${RELOCATING+*(.rel.text:*)}
46 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
47 }
48 .rela.text ${RELOCATING-0} :
49 {
50 *(.rela.text)
51 ${RELOCATING+*(.rela.text.*)}
52 ${RELOCATING+*(.rela.text:*)}
53 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
54 }
55 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
56 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
57 .rel.rodata ${RELOCATING-0} :
58 {
59 *(.rel.rodata)
60 ${RELOCATING+*(.rel.rodata.*)}
61 ${RELOCATING+*(.rel.rodata:*)}
62 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
63 }
64 .rela.rodata ${RELOCATING-0} :
65 {
66 *(.rela.rodata)
67 ${RELOCATING+*(.rela.rodata.*)}
68 ${RELOCATING+*(.rela.rodata:*)}
69 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
70 }
71 .rel.data ${RELOCATING-0} :
72 {
73 *(.rel.data)
74 ${RELOCATING+*(.rel.data.*)}
75 ${RELOCATING+*(.rel.data:*)}
76 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
77 }
78 .rela.data ${RELOCATING-0} :
79 {
80 *(.rela.data)
81 ${RELOCATING+*(.rela.data.*)}
82 ${RELOCATING+*(.rela.data:*)}
83 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
84 }
85 .rel.init_array ${RELOCATING-0} : { *(.rel.init_array) }
86 .rela.init_array ${RELOCATING-0} : { *(.rela.init_array) }
87 .rel.fini_array ${RELOCATING-0} : { *(.rel.fini_array) }
88 .rela.fini_array ${RELOCATING-0} : { *(.rela.fini_array) }
89 .rel.got ${RELOCATING-0} : { *(.rel.got) }
90 .rela.got ${RELOCATING-0} : { *(.rela.got) }
91 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
92 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
93 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
94 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
95
96 /* Internal text space. */
97 .text ${RELOCATING-0} :
98 {
99 ${RELOCATING+ _text_start = . ; }
100
101 ${RELOCATING+. = ALIGN(4);}
102
103 ${RELOCATING+*(.init0) /* Start here after reset. */}
104 ${RELOCATING+KEEP (*(.init0))}
105
106 ${RELOCATING+. = ALIGN(4);}
107 *(.text)
108 ${RELOCATING+. = ALIGN(4);}
109 ${RELOCATING+*(.text.*)}
110 ${RELOCATING+. = ALIGN(4);}
111 ${RELOCATING+*(.text:*)}
112 ${RELOCATING+. = ALIGN(4);}
113 ${RELOCATING+*(.gnu.linkonce.t*)}
114 ${RELOCATING+. = ALIGN(4);}
115
116 ${RELOCATING+ _text_end = . ; }
117 } ${RELOCATING+ > imem}
118
119 .data ${RELOCATING-0} :
120 {
121 /* Optional variable that user is prepared to have NULL address. */
122 ${RELOCATING+ *(.data.atzero*)}
123
124 /* CRT is prepared for constructor/destructor table to have
125 a "valid" NULL address. */
126 ${CONSTRUCTING+ __init_array_start = . ; }
127 ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))}
128 ${CONSTRUCTING+ KEEP (*(.init_array))}
129 ${CONSTRUCTING+ __init_array_end = . ; }
130 ${CONSTRUCTING+ __fini_array_start = . ; }
131 ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))}
132 ${CONSTRUCTING+ KEEP (*(.fini_array))}
133 ${CONSTRUCTING+ __fini_array_end = . ; }
134
135 ${RELOCATING+/* DATA memory starts at address 0. So to avoid placing a valid static
136 variable at the invalid NULL address, we introduce the .data.atzero
137 section. If CRT can make some use of it - great. Otherwise skip a
138 word. In all cases .data/.bss sections must start at non-zero. */
139 . += (. == 0 ? 4 : 0);}
140
141 ${RELOCATING+ PROVIDE (_data_start = .) ; }
142 *(.data)
143 ${RELOCATING+ *(.data*)}
144 ${RELOCATING+ *(.data:*)}
145 ${RELOCATING+ *(.rodata) /* We need to include .rodata here if gcc is used. */}
146 ${RELOCATING+ *(.rodata.*) /* with -fdata-sections. */}
147 ${RELOCATING+ *(.rodata:*)}
148 ${RELOCATING+*(.gnu.linkonce.d*)}
149 ${RELOCATING+*(.gnu.linkonce.r*)}
150 ${RELOCATING+. = ALIGN(4);}
151 ${RELOCATING+ PROVIDE (_data_end = .) ; }
152 } ${RELOCATING+ > dmem }
153
154 .resource_table ${RELOCATING-0} :
155 {
156 /* Linux remoteproc loader requires the resource table address
157 to be aligned to 8 bytes. */
158 ${RELOCATING+. = ALIGN(8);}
159 KEEP (*(.resource_table))
160 } ${RELOCATING+ > dmem}
161
162 .bss ${RELOCATING-0} :
163 {
164 ${RELOCATING+ PROVIDE (_bss_start = .) ; }
165 *(.bss)
166 ${RELOCATING+ *(.bss.*)}
167 ${RELOCATING+ *(.bss:*)}
168 ${RELOCATING+*(.gnu.linkonce.b*)}
169 ${RELOCATING+*(COMMON)}
170 ${RELOCATING+ PROVIDE (_bss_end = .) ; }
171 } ${RELOCATING+ > dmem}
172
173 /* Global data not cleared after reset. */
174 .noinit ${RELOCATING-0} :
175 {
176 ${RELOCATING+ PROVIDE (_noinit_start = .) ; }
177 *(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*})
178 ${RELOCATING+ PROVIDE (_noinit_end = .) ; }
179 ${RELOCATING+ PROVIDE (_heap_start = .) ; }
180 ${RELOCATING+ . += __HEAP_SIZE ; }
181 ${RELOCATING+/* Stack is not here really. It will be put at the end of DMEM.
182 But we take into account its size here, in order to allow
183 for MEMORY overflow checking during link time. */}
184 ${RELOCATING+ . += __STACK_SIZE ; }
185 } ${RELOCATING+ > dmem}
186
187 /* Stabs debugging sections. */
188 .stab 0 : { *(.stab) }
189 .stabstr 0 : { *(.stabstr) }
190 .stab.excl 0 : { *(.stab.excl) }
191 .stab.exclstr 0 : { *(.stab.exclstr) }
192 .stab.index 0 : { *(.stab.index) }
193 .stab.indexstr 0 : { *(.stab.indexstr) }
194 .comment 0 : { *(.comment) }
195 .note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) }
196 EOF
197
198 . $srcdir/scripttempl/DWARF.sc
199
200 cat <<EOF
201 }
202 EOF
This page took 0.032702 seconds and 4 git commands to generate.