]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/scripttempl/v850.sc
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / scripttempl / v850.sc
CommitLineData
250d07de 1# Copyright (C) 2014-2021 Free Software Foundation, Inc.
6c19b93b 2#
985743c7
NC
3# Copying and distribution of this file, with or without modification,
4# are permitted in any medium without royalty provided the copyright
5# notice and this notice are preserved.
6
252b5132 7cat << EOF
250d07de 8/* Copyright (C) 2014-2021 Free Software Foundation, Inc.
985743c7
NC
9
10 Copying and distribution of this script, with or without modification,
11 are permitted in any medium without royalty provided the copyright
12 notice and this notice are preserved. */
13
252b5132
RH
14OUTPUT_FORMAT("elf32-v850", "elf32-v850",
15 "elf32-v850")
4b05e0a7 16OUTPUT_ARCH(v850:old-gcc-abi)
b34c1498 17${RELOCATING+ENTRY(_start)}
252b5132 18SEARCH_DIR(.);
76276ff6 19${RELOCATING+EXTERN(__ctbp __ep __gp)};
252b5132
RH
20SECTIONS
21{
22 /* This saves a little space in the ELF file, since the zda starts
23 at a higher location that the ELF headers take up. */
24
40a633d5
NC
25 .zdata ${ZDATA_START_ADDR} :
26 {
252b5132 27 *(.zdata)
2bf2bf23 28 ${RELOCATING+*(.zbss)
252b5132 29 *(reszdata)
2bf2bf23 30 *(.zcommon)}
252b5132
RH
31 }
32
33 /* This is the read only part of the zero data area.
b81c93c8 34 Having it as a separate section prevents its
252b5132
RH
35 attributes from being inherited by the zdata
36 section. Specifically it prevents the zdata
37 section from being marked READONLY. */
38
40a633d5
NC
39 .rozdata ${ROZDATA_START_ADDR} :
40 {
252b5132 41 *(.rozdata)
2bf2bf23
AM
42 ${RELOCATING+*(romzdata)
43 *(romzbss)}
252b5132
RH
44 }
45
40a633d5 46 /* Read-only sections, merged into text segment. */
252b5132
RH
47 . = ${TEXT_START_ADDR};
48 .interp : { *(.interp) }
49 .hash : { *(.hash) }
50 .dynsym : { *(.dynsym) }
51 .dynstr : { *(.dynstr) }
52 .rel.text : { *(.rel.text) }
53 .rela.text : { *(.rela.text) }
54 .rel.data : { *(.rel.data) }
55 .rela.data : { *(.rela.data) }
56 .rel.rodata : { *(.rel.rodata) }
57 .rela.rodata : { *(.rela.rodata) }
cedacdc0
CM
58 .rel.gcc_except_table : { *(.rel.gcc_except_table) }
59 .rela.gcc_except_table : { *(.rela.gcc_except_table) }
252b5132
RH
60 .rel.got : { *(.rel.got) }
61 .rela.got : { *(.rela.got) }
62 .rel.ctors : { *(.rel.ctors) }
63 .rela.ctors : { *(.rela.ctors) }
64 .rel.dtors : { *(.rel.dtors) }
65 .rela.dtors : { *(.rela.dtors) }
66 .rel.init : { *(.rel.init) }
67 .rela.init : { *(.rela.init) }
68 .rel.fini : { *(.rel.fini) }
69 .rela.fini : { *(.rela.fini) }
70 .rel.bss : { *(.rel.bss) }
71 .rela.bss : { *(.rela.bss) }
72 .rel.plt : { *(.rel.plt) }
73 .rela.plt : { *(.rela.plt) }
2d3181c7 74 .init : { KEEP (*(SORT_NONE(.init))) } =0
252b5132
RH
75 .plt : { *(.plt) }
76
40a633d5
NC
77 .text :
78 {
252b5132
RH
79 *(.text)
80 ${RELOCATING+*(.text.*)}
6c19b93b 81
075a2b89 82 /* .gnu.warning sections are handled specially by elf.em. */
252b5132 83 *(.gnu.warning)
2bf2bf23 84 ${RELOCATING+*(.gnu.linkonce.t*)}
252b5132
RH
85 } =0
86
87 ${RELOCATING+_etext = .;}
88 ${RELOCATING+PROVIDE (etext = .);}
89
90 /* This is special code area at the end of the normal text section.
91 It contains a small lookup table at the start followed by the
92 code pointed to by entries in the lookup table. */
93
40a633d5
NC
94 .call_table_data ${CALL_TABLE_START_ADDR} :
95 {
252b5132
RH
96 ${RELOCATING+PROVIDE(__ctbp = .);}
97 *(.call_table_data)
40a633d5 98 } = 0xff /* Fill gaps with 0xff. */
6c19b93b 99
40a633d5
NC
100 .call_table_text :
101 {
252b5132
RH
102 *(.call_table_text)
103 }
104
2d3181c7 105 .fini : { KEEP (*(SORT_NONE(.fini))) } =0
2bf2bf23 106 .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*) *(.gnu.linkonce.r*)} }
252b5132
RH
107 .rodata1 : { *(.rodata1) }
108
40a633d5
NC
109 .data :
110 {
252b5132 111 *(.data)
2bf2bf23
AM
112 ${RELOCATING+*(.data.*)
113 *(.gnu.linkonce.d*)}
114 ${CONSTRUCTING+CONSTRUCTORS}
252b5132
RH
115 }
116 .data1 : { *(.data1) }
40a633d5
NC
117 .ctors :
118 {
119 ${CONSTRUCTING+___ctors = .;}
4305932a 120 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
2bf2bf23 121 ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
4305932a 122 KEEP (*crtend(.ctors))
40a633d5 123 ${CONSTRUCTING+___ctors_end = .;}
252b5132 124 }
40a633d5
NC
125 .dtors :
126 {
127 ${CONSTRUCTING+___dtors = .;}
4305932a 128 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
2bf2bf23 129 ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
4305932a 130 KEEP (*crtend.o(.dtors))
40a633d5 131 ${CONSTRUCTING+___dtors_end = .;}
252b5132 132 }
24098abb
RH
133 .jcr :
134 {
135 KEEP (*(.jcr))
136 }
252b5132 137
cedacdc0
CM
138 .gcc_except_table : { *(.gcc_except_table) }
139
2bf2bf23 140 .got : {${RELOCATING+ *(.got.plt)} *(.got) }
252b5132
RH
141 .dynamic : { *(.dynamic) }
142
40a633d5
NC
143 .tdata ${TDATA_START_ADDR} :
144 {
2bf2bf23 145 ${RELOCATING+PROVIDE (__ep = .);
252b5132 146 *(.tbyte)
2bf2bf23 147 *(.tcommon_byte)}
252b5132 148 *(.tdata)
2bf2bf23
AM
149 ${RELOCATING+*(.tbss)
150 *(.tcommon)}
252b5132
RH
151 }
152
153 /* We want the small data sections together, so single-instruction offsets
154 can access them all, and initialized data all before uninitialized, so
155 we can shorten the on-disk segment size. */
6c19b93b 156
40a633d5
NC
157 .sdata ${SDATA_START_ADDR} :
158 {
252b5132
RH
159 ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
160 *(.sdata)
161 }
162
163 /* See comment about .rozdata. */
40a633d5
NC
164 .rosdata ${ROSDATA_START_ADDR} :
165 {
252b5132
RH
166 *(.rosdata)
167 }
168
169 /* We place the .sbss data section AFTER the .rosdata section, so that
b81c93c8 170 it can directly precede the .bss section. This allows runtime startup
252b5132 171 code to initialise all the zero-data sections by simply taking the
40a633d5 172 value of '_edata' and zeroing until it reaches '_end'. */
6c19b93b 173
40a633d5
NC
174 .sbss :
175 {
252b5132
RH
176 ${RELOCATING+__sbss_start = .;}
177 *(.sbss)
2bf2bf23 178 ${RELOCATING+*(.scommon)}
252b5132
RH
179 }
180
181 ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
182 ${RELOCATING+PROVIDE (edata = _edata);}
183
184 .bss :
185 {
186 ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
187 ${RELOCATING+__real_bss_start = . ;}
2bf2bf23 188 ${RELOCATING+*(.dynbss)}
252b5132 189 *(.bss)
2bf2bf23 190 ${RELOCATING+*(COMMON)}
252b5132
RH
191 }
192
193 ${RELOCATING+_end = . ;}
194 ${RELOCATING+PROVIDE (end = .);}
f20db198 195 ${RELOCATING+PROVIDE (_heap_start = .);}
252b5132 196
6c19b93b 197 .note.renesas 0 : { KEEP(*(.note.renesas)) }
685080f2 198
252b5132
RH
199 /* Stabs debugging sections. */
200 .stab 0 : { *(.stab) }
201 .stabstr 0 : { *(.stabstr) }
202 .stab.excl 0 : { *(.stab.excl) }
203 .stab.exclstr 0 : { *(.stab.exclstr) }
204 .stab.index 0 : { *(.stab.index) }
205 .stab.indexstr 0 : { *(.stab.indexstr) }
206 .comment 0 : { *(.comment) }
207
ceb0a680
NC
208EOF
209
d061dfac 210. $srcdir/scripttempl/DWARF.sc
2a995fc1 211
ceb0a680 212cat <<EOF
40a633d5
NC
213 /* User stack. */
214 .stack 0x200000 :
215 {
252b5132
RH
216 ${RELOCATING+__stack = .;}
217 *(.stack)
218 }
252b5132
RH
219}
220EOF