1 # Copyright (C) 2014-2016 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-2016 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", "elf32-v850",
16 OUTPUT_ARCH(v850:old-gcc-abi)
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} :
33 /* This is the read only part of the zero data area.
34 Having it as a separate section prevents its
35 attributes from being inherited by the zdata
36 section. Specifically it prevents the zdata
37 section from being marked READONLY. */
39 .rozdata ${ROZDATA_START_ADDR} :
46 /* Read-only sections, merged into text segment. */
47 . = ${TEXT_START_ADDR};
48 .interp : { *(.interp) }
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) }
58 .rel.gcc_except_table : { *(.rel.gcc_except_table) }
59 .rela.gcc_except_table : { *(.rela.gcc_except_table) }
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) }
74 .init : { KEEP (*(.init)) } =0
80 ${RELOCATING+*(.text.*)}
82 /* .gnu.warning sections are handled specially by elf32.em. */
87 ${RELOCATING+_etext = .;}
88 ${RELOCATING+PROVIDE (etext = .);}
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. */
94 .call_table_data ${CALL_TABLE_START_ADDR} :
96 ${RELOCATING+PROVIDE(__ctbp = .);}
98 } = 0xff /* Fill gaps with 0xff. */
105 .fini : { KEEP (*(.fini)) } =0
106 .rodata : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) }
107 .rodata1 : { *(.rodata1) }
112 ${RELOCATING+*(.data.*)}
116 .data1 : { *(.data1) }
119 ${CONSTRUCTING+___ctors = .;}
120 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
121 KEEP (*(SORT(.ctors.*)))
122 KEEP (*crtend(.ctors))
123 ${CONSTRUCTING+___ctors_end = .;}
127 ${CONSTRUCTING+___dtors = .;}
128 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
129 KEEP (*(SORT(.dtors.*)))
130 KEEP (*crtend.o(.dtors))
131 ${CONSTRUCTING+___dtors_end = .;}
138 .gcc_except_table : { *(.gcc_except_table) }
140 .got : { *(.got.plt) *(.got) }
141 .dynamic : { *(.dynamic) }
143 .tdata ${TDATA_START_ADDR} :
145 ${RELOCATING+PROVIDE (__ep = .);}
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. */
157 .sdata ${SDATA_START_ADDR} :
159 ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
163 /* See comment about .rozdata. */
164 .rosdata ${ROSDATA_START_ADDR} :
169 /* We place the .sbss data section AFTER the .rosdata section, so that
170 it can directly precede the .bss section. This allows runtime startup
171 code to initialise all the zero-data sections by simply taking the
172 value of '_edata' and zeroing until it reaches '_end'. */
176 ${RELOCATING+__sbss_start = .;}
181 ${RELOCATING+_edata = DEFINED (__sbss_start) ? __sbss_start : . ;}
182 ${RELOCATING+PROVIDE (edata = _edata);}
186 ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
187 ${RELOCATING+__real_bss_start = . ;}
193 ${RELOCATING+_end = . ;}
194 ${RELOCATING+PROVIDE (end = .);}
195 ${RELOCATING+PROVIDE (_heap_start = .);}
197 .note.renesas 0 : { KEEP(*(.note.renesas)) }
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) }
210 . $srcdir/scripttempl/DWARF.sc
216 ${RELOCATING+__stack = .;}