1 # Copyright (C) 2014-2024 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-2024 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 /* PR 32100: GDB makes use of the fact that the .note.gnu.build-id
23 section is typically placed next to the ELF headers. */
24 .note.gnu.build-id ${RELOCATING-0}: { *(.note.gnu.build-id) }
26 /* This saves a little space in the ELF file, since the zda starts
27 at a higher location that the ELF headers take up. */
29 .zdata ${ZDATA_START_ADDR} :
32 ${RELOCATING+*(.zdata23)
39 /* This is the read only part of the zero data area.
40 Having it as a separate section prevents its
41 attributes from being inherited by the zdata
42 section. Specifically it prevents the zdata
43 section from being marked READONLY. */
45 .rozdata ${ROZDATA_START_ADDR} :
48 ${RELOCATING+*(romzdata)
54 /* Read-only sections, merged into text segment. */
55 . = ${TEXT_START_ADDR};
56 .interp : { *(.interp) }
58 .dynsym : { *(.dynsym) }
59 .dynstr : { *(.dynstr) }
60 .rel.text : { *(.rel.text) }
61 .rela.text : { *(.rela.text) }
62 .rel.data : { *(.rel.data) }
63 .rela.data : { *(.rela.data) }
64 .rel.rodata : { *(.rel.rodata) }
65 .rela.rodata : { *(.rela.rodata) }
66 .rel.gcc_except_table : { *(.rel.gcc_except_table) }
67 .rela.gcc_except_table : { *(.rela.gcc_except_table) }
68 .rel.got : { *(.rel.got) }
69 .rela.got : { *(.rela.got) }
70 .rel.ctors : { *(.rel.ctors) }
71 .rela.ctors : { *(.rela.ctors) }
72 .rel.dtors : { *(.rel.dtors) }
73 .rela.dtors : { *(.rela.dtors) }
74 .rel.init : { *(.rel.init) }
75 .rela.init : { *(.rela.init) }
76 .rel.fini : { *(.rel.fini) }
77 .rela.fini : { *(.rela.fini) }
78 .rel.bss : { *(.rel.bss) }
79 .rela.bss : { *(.rela.bss) }
80 .rel.plt : { *(.rel.plt) }
81 .rela.plt : { *(.rela.plt) }
82 .init : { KEEP (*(SORT_NONE(.init))) } =0
88 ${RELOCATING+*(.text.*)}
90 /* .gnu.warning sections are handled specially by elf.em. */
92 ${RELOCATING+*(.gnu.linkonce.t*)}
95 ${RELOCATING+_etext = .;}
96 ${RELOCATING+PROVIDE (etext = .);}
98 /* This is special code area at the end of the normal text section.
99 It contains a small lookup table at the start followed by the
100 code pointed to by entries in the lookup table. */
102 .call_table_data ${CALL_TABLE_START_ADDR} :
104 ${RELOCATING+PROVIDE(__ctbp = .);}
106 } = 0xff /* Fill gaps with 0xff. */
113 .fini : { KEEP (*(SORT_NONE(.fini))) } =0
117 ${RELOCATING+*(.rodata.*)
121 .rodata1 : { *(.rodata1) }
126 ${RELOCATING+*(.data.*)
128 ${CONSTRUCTING+CONSTRUCTORS}
130 .data1 : { *(.data1) }
133 ${CONSTRUCTING+___ctors = .;}
134 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
135 ${RELOCATING+KEEP (*(SORT(.ctors.*)))}
136 KEEP (*crtend(.ctors))
137 ${CONSTRUCTING+___ctors_end = .;}
141 ${CONSTRUCTING+___dtors = .;}
142 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
143 ${RELOCATING+KEEP (*(SORT(.dtors.*)))}
144 KEEP (*crtend.o(.dtors))
145 ${CONSTRUCTING+___dtors_end = .;}
152 .gcc_except_table : { *(.gcc_except_table) }
154 .got : {${RELOCATING+ *(.got.plt)} *(.got) }
155 .dynamic : { *(.dynamic) }
157 .tdata ${TDATA_START_ADDR} :
159 ${RELOCATING+PROVIDE (__ep = .);
165 ${RELOCATING+*(.tdata*)
173 /* We want the small data sections together, so single-instruction offsets
174 can access them all, and initialized data all before uninitialized, so
175 we can shorten the on-disk segment size. */
177 .sdata ${SDATA_START_ADDR} :
179 ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
181 ${RELOCATING+*(.sdata23)}
184 /* See comment about .rozdata. */
185 .rosdata ${ROSDATA_START_ADDR} :
188 ${RELOCATING+*(.sconst)
192 /* We place the .sbss data section AFTER the .rosdata section, so that
193 it can directly precede the .bss section. This allows runtime startup
194 code to initialise all the zero-data sections by simply taking the
195 value of '_edata' and zeroing until it reaches '_end'. */
199 ${RELOCATING+__sbss_start = .;}
201 ${RELOCATING+*(.sbss23)
205 ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
206 ${RELOCATING+PROVIDE (edata = _edata);}
210 ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
211 ${RELOCATING+__real_bss_start = . ;}
212 ${RELOCATING+*(.dynbss)}
214 ${RELOCATING+*(COMMON)}
217 ${RELOCATING+_end = . ;}
218 ${RELOCATING+PROVIDE (end = .);}
219 ${RELOCATING+PROVIDE (_heap_start = .);}
221 .note.renesas 0 : { KEEP(*(.note.renesas)) }
225 source_sh $srcdir/scripttempl/misc-sections.sc
226 source_sh $srcdir/scripttempl/DWARF.sc
232 ${RELOCATING+__stack = .;}