1 # Copyright (C) 2014-2019 Free Software Foundation, Inc.
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.
8 /* Copyright (C) 2014-2019 Free Software Foundation, Inc.
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. */
14 OUTPUT_FORMAT("elf32-v850-rh850", "elf32-v850-rh850",
16 OUTPUT_ARCH(v850:rh850)
17 ${RELOCATING+ENTRY(_start)}
19 ${RELOCATING+EXTERN(__ctbp __ep __gp)};
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. */
25 .zdata ${ZDATA_START_ADDR} :
28 ${RELOCATING+*(.zdata23)
35 /* This is the read only part of the zero data area.
36 Having it as a separate section prevents its
37 attributes from being inherited by the zdata
38 section. Specifically it prevents the zdata
39 section from being marked READONLY. */
41 .rozdata ${ROZDATA_START_ADDR} :
44 ${RELOCATING+*(romzdata)
50 /* Read-only sections, merged into text segment. */
51 . = ${TEXT_START_ADDR};
52 .interp : { *(.interp) }
54 .dynsym : { *(.dynsym) }
55 .dynstr : { *(.dynstr) }
56 .rel.text : { *(.rel.text) }
57 .rela.text : { *(.rela.text) }
58 .rel.data : { *(.rel.data) }
59 .rela.data : { *(.rela.data) }
60 .rel.rodata : { *(.rel.rodata) }
61 .rela.rodata : { *(.rela.rodata) }
62 .rel.gcc_except_table : { *(.rel.gcc_except_table) }
63 .rela.gcc_except_table : { *(.rela.gcc_except_table) }
64 .rel.got : { *(.rel.got) }
65 .rela.got : { *(.rela.got) }
66 .rel.ctors : { *(.rel.ctors) }
67 .rela.ctors : { *(.rela.ctors) }
68 .rel.dtors : { *(.rel.dtors) }
69 .rela.dtors : { *(.rela.dtors) }
70 .rel.init : { *(.rel.init) }
71 .rela.init : { *(.rela.init) }
72 .rel.fini : { *(.rel.fini) }
73 .rela.fini : { *(.rela.fini) }
74 .rel.bss : { *(.rel.bss) }
75 .rela.bss : { *(.rela.bss) }
76 .rel.plt : { *(.rel.plt) }
77 .rela.plt : { *(.rela.plt) }
78 .init : { KEEP (*(SORT_NONE(.init))) } =0
84 ${RELOCATING+*(.text.*)}
86 /* .gnu.warning sections are handled specially by elf32.em. */
88 ${RELOCATING+*(.gnu.linkonce.t*)}
91 ${RELOCATING+_etext = .;}
92 ${RELOCATING+PROVIDE (etext = .);}
94 /* This is special code area at the end of the normal text section.
95 It contains a small lookup table at the start followed by the
96 code pointed to by entries in the lookup table. */
98 .call_table_data ${CALL_TABLE_START_ADDR} :
100 ${RELOCATING+PROVIDE(__ctbp = .);}
102 } = 0xff /* Fill gaps with 0xff. */
109 .fini : { KEEP (*(SORT_NONE(.fini))) } =0
113 ${RELOCATING+*(.rodata.*)
117 .rodata1 : { *(.rodata1) }
122 ${RELOCATING+*(.data.*)
124 ${CONSTRUCTING+CONSTRUCTORS}
126 .data1 : { *(.data1) }
129 ${CONSTRUCTING+___ctors = .;}
130 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
131 ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
132 KEEP (*crtend(.ctors))
133 ${CONSTRUCTING+___ctors_end = .;}
137 ${CONSTRUCTING+___dtors = .;}
138 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
139 ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
140 KEEP (*crtend.o(.dtors))
141 ${CONSTRUCTING+___dtors_end = .;}
148 .gcc_except_table : { *(.gcc_except_table) }
150 .got : {${RELOCATING+ *(.got.plt)} *(.got) }
151 .dynamic : { *(.dynamic) }
153 .tdata ${TDATA_START_ADDR} :
155 ${RELOCATING+PROVIDE (__ep = .);
161 ${RELOCATING+*(.tdata*)
169 /* We want the small data sections together, so single-instruction offsets
170 can access them all, and initialized data all before uninitialized, so
171 we can shorten the on-disk segment size. */
173 .sdata ${SDATA_START_ADDR} :
175 ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
177 ${RELOCATING+*(.sdata23)}
180 /* See comment about .rozdata. */
181 .rosdata ${ROSDATA_START_ADDR} :
184 ${RELOCATING+*(.sconst)
188 /* We place the .sbss data section AFTER the .rosdata section, so that
189 it can directly precede the .bss section. This allows runtime startup
190 code to initialise all the zero-data sections by simply taking the
191 value of '_edata' and zeroing until it reaches '_end'. */
195 ${RELOCATING+__sbss_start = .;}
197 ${RELOCATING+*(.sbss23)
201 ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
202 ${RELOCATING+PROVIDE (edata = _edata);}
206 ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
207 ${RELOCATING+__real_bss_start = . ;}
208 ${RELOCATING+*(.dynbss)}
210 ${RELOCATING+*(COMMON)}
213 ${RELOCATING+_end = . ;}
214 ${RELOCATING+PROVIDE (end = .);}
215 ${RELOCATING+PROVIDE (_heap_start = .);}
217 .note.renesas 0 : { KEEP(*(.note.renesas)) }
219 /* Stabs debugging sections. */
220 .stab 0 : { *(.stab) }
221 .stabstr 0 : { *(.stabstr) }
222 .stab.excl 0 : { *(.stab.excl) }
223 .stab.exclstr 0 : { *(.stab.exclstr) }
224 .stab.index 0 : { *(.stab.index) }
225 .stab.indexstr 0 : { *(.stab.indexstr) }
226 .comment 0 : { *(.comment) }
230 . $srcdir/scripttempl/DWARF.sc
236 ${RELOCATING+__stack = .;}