1 # Copyright (C) 2014 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 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 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} :
35 /* This is the read only part of the zero data area.
36 Having it as a seperate 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} :
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 (*(.init)) } =0
84 ${RELOCATING+*(.text.*)}
86 /* .gnu.warning sections are handled specially by elf32.em. */
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 (*(.fini)) } =0
113 ${RELOCATING+*(.rodata.*)}
117 .rodata1 : { *(.rodata1) }
122 ${RELOCATING+*(.data.*)}
126 .data1 : { *(.data1) }
129 ${CONSTRUCTING+___ctors = .;}
130 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
131 KEEP (*(SORT(.ctors.*)))
132 KEEP (*crtend(.ctors))
133 ${CONSTRUCTING+___ctors_end = .;}
137 ${CONSTRUCTING+___dtors = .;}
138 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
139 KEEP (*(SORT(.dtors.*)))
140 KEEP (*crtend.o(.dtors))
141 ${CONSTRUCTING+___dtors_end = .;}
148 .gcc_except_table : { *(.gcc_except_table) }
150 .got : { *(.got.plt) *(.got) }
151 .dynamic : { *(.dynamic) }
153 .tdata ${TDATA_START_ADDR} :
155 ${RELOCATING+PROVIDE (__ep = .);}
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);}
180 /* See comment about .rozdata. */
181 .rosdata ${ROSDATA_START_ADDR} :
188 /* We place the .sbss data section AFTER the .rosdata section, so that
189 it can directly preceed 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 = .;}
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 = . ;}
213 ${RELOCATING+_end = . ;}
214 ${RELOCATING+PROVIDE (end = .);}
215 ${RELOCATING+PROVIDE (_heap_start = .);}
217 /* Stabs debugging sections. */
218 .stab 0 : { *(.stab) }
219 .stabstr 0 : { *(.stabstr) }
220 .stab.excl 0 : { *(.stab.excl) }
221 .stab.exclstr 0 : { *(.stab.exclstr) }
222 .stab.index 0 : { *(.stab.index) }
223 .stab.indexstr 0 : { *(.stab.indexstr) }
224 .comment 0 : { *(.comment) }
228 . $srcdir/scripttempl/DWARF.sc
234 ${RELOCATING+__stack = .;}