* scripttempl/v850.sc: Add gcc_except_table sections.
[platform/upstream/binutils.git] / ld / scripttempl / v850.sc
1 cat << EOF
2 OUTPUT_FORMAT("elf32-v850", "elf32-v850",
3               "elf32-v850")
4 OUTPUT_ARCH(v850)
5 ENTRY(_start)
6 SEARCH_DIR(.);
7 SECTIONS
8 {
9   /* This saves a little space in the ELF file, since the zda starts
10      at a higher location that the ELF headers take up.  */
11
12   .zdata ${ZDATA_START_ADDR} :
13   {
14         *(.zdata)
15         *(.zbss)
16         *(reszdata)
17         *(.zcommon)
18   }
19
20   /* This is the read only part of the zero data area.
21      Having it as a seperate section prevents its
22      attributes from being inherited by the zdata
23      section.  Specifically it prevents the zdata
24      section from being marked READONLY.  */
25
26   .rozdata ${ROZDATA_START_ADDR} :
27   {
28         *(.rozdata)
29         *(romzdata)
30         *(romzbss)
31   }
32
33   /* Read-only sections, merged into text segment.  */
34   . = ${TEXT_START_ADDR};
35   .interp       : { *(.interp) }
36   .hash         : { *(.hash) }
37   .dynsym       : { *(.dynsym) }
38   .dynstr       : { *(.dynstr) }
39   .rel.text     : { *(.rel.text) }
40   .rela.text    : { *(.rela.text) }
41   .rel.data     : { *(.rel.data) }
42   .rela.data    : { *(.rela.data) }
43   .rel.rodata   : { *(.rel.rodata) }
44   .rela.rodata  : { *(.rela.rodata) }
45   .rel.gcc_except_table : { *(.rel.gcc_except_table) }
46   .rela.gcc_except_table : { *(.rela.gcc_except_table) }
47   .rel.got      : { *(.rel.got) }
48   .rela.got     : { *(.rela.got) }
49   .rel.ctors    : { *(.rel.ctors) }
50   .rela.ctors   : { *(.rela.ctors) }
51   .rel.dtors    : { *(.rel.dtors) }
52   .rela.dtors   : { *(.rela.dtors) }
53   .rel.init     : { *(.rel.init) }
54   .rela.init    : { *(.rela.init) }
55   .rel.fini     : { *(.rel.fini) }
56   .rela.fini    : { *(.rela.fini) }
57   .rel.bss      : { *(.rel.bss) }
58   .rela.bss     : { *(.rela.bss) }
59   .rel.plt      : { *(.rel.plt) }
60   .rela.plt     : { *(.rela.plt) }
61   .init         : { KEEP (*(.init)) } =0
62   .plt          : { *(.plt) }
63
64   .text         :
65   {
66     *(.text)
67     ${RELOCATING+*(.text.*)}
68     
69     /* .gnu.warning sections are handled specially by elf32.em.  */
70     *(.gnu.warning)
71     *(.gnu.linkonce.t*)
72   } =0
73
74   ${RELOCATING+_etext = .;}
75   ${RELOCATING+PROVIDE (etext = .);}
76
77    /* This is special code area at the end of the normal text section.
78       It contains a small lookup table at the start followed by the
79       code pointed to by entries in the lookup table.  */
80
81   .call_table_data ${CALL_TABLE_START_ADDR} :
82   {
83     ${RELOCATING+PROVIDE(__ctbp = .);}
84     *(.call_table_data)
85   } = 0xff   /* Fill gaps with 0xff.  */
86   
87   .call_table_text :
88   {
89     *(.call_table_text)
90   }
91
92   .fini         : { KEEP (*(.fini)) } =0
93   .rodata       : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) }
94   .rodata1      : { *(.rodata1) }
95
96   .data         :
97   {
98     *(.data)
99     ${RELOCATING+*(.data.*)}
100     *(.gnu.linkonce.d*)
101     CONSTRUCTORS
102   }
103   .data1        : { *(.data1) }
104   .ctors        :
105   {
106     ${CONSTRUCTING+___ctors = .;}
107     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
108     KEEP (*(SORT(.ctors.*)))
109     KEEP (*crtend(.ctors))
110     ${CONSTRUCTING+___ctors_end = .;}
111   }
112   .dtors        :
113   {
114     ${CONSTRUCTING+___dtors = .;}
115     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
116     KEEP (*(SORT(.dtors.*)))
117     KEEP (*crtend.o(.dtors))
118     ${CONSTRUCTING+___dtors_end = .;}
119   }
120   .jcr          :
121   {
122     KEEP (*(.jcr))
123   }
124
125   .gcc_except_table : { *(.gcc_except_table) }
126
127   .got          : { *(.got.plt) *(.got) }
128   .dynamic      : { *(.dynamic) }
129
130   .tdata ${TDATA_START_ADDR} :
131   {
132         ${RELOCATING+PROVIDE (__ep = .);}
133         *(.tbyte)
134         *(.tcommon_byte)
135         *(.tdata)
136         *(.tbss)
137         *(.tcommon)
138   }
139
140   /* We want the small data sections together, so single-instruction offsets
141      can access them all, and initialized data all before uninitialized, so
142      we can shorten the on-disk segment size.  */
143      
144   .sdata ${SDATA_START_ADDR} :
145   {
146         ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
147         *(.sdata)
148    }
149
150   /* See comment about .rozdata. */
151   .rosdata ${ROSDATA_START_ADDR} :
152   {
153         *(.rosdata)
154   }
155
156   /* We place the .sbss data section AFTER the .rosdata section, so that
157      it can directly preceed the .bss section.  This allows runtime startup
158      code to initialise all the zero-data sections by simply taking the
159      value of '_edata' and zeroing until it reaches '_end'.  */
160      
161   .sbss :
162   {
163         ${RELOCATING+__sbss_start = .;}
164         *(.sbss)
165         *(.scommon)
166   }
167
168   ${RELOCATING+_edata  = DEFINED (__sbss_start) ? __sbss_start : . ;}
169   ${RELOCATING+PROVIDE (edata = _edata);}
170
171   .bss       :
172   {
173         ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
174         ${RELOCATING+__real_bss_start = . ;}
175         *(.dynbss)
176         *(.bss)
177         *(COMMON)
178   }
179
180   ${RELOCATING+_end = . ;}
181   ${RELOCATING+PROVIDE (end = .);}
182
183   /* Stabs debugging sections.  */
184   .stab 0               : { *(.stab) }
185   .stabstr 0            : { *(.stabstr) }
186   .stab.excl 0          : { *(.stab.excl) }
187   .stab.exclstr 0       : { *(.stab.exclstr) }
188   .stab.index 0         : { *(.stab.index) }
189   .stab.indexstr 0      : { *(.stab.indexstr) }
190   .comment 0            : { *(.comment) }
191
192   /* DWARF debug sections.
193      Symbols in the DWARF debugging sections are relative to the beginning
194      of the section so we begin them at 0.  */
195
196   /* DWARF 1 */
197   .debug          0     : { *(.debug) }
198   .line           0     : { *(.line) }
199
200   /* GNU DWARF 1 extensions */
201   .debug_srcinfo  0     : { *(.debug_srcinfo) }
202   .debug_sfnames  0     : { *(.debug_sfnames) }
203
204   /* DWARF 1.1 and DWARF 2 */
205   .debug_aranges  0     : { *(.debug_aranges) }
206   .debug_pubnames 0     : { *(.debug_pubnames) }
207
208   /* DWARF 2 */
209   .debug_info     0     : { *(.debug_info) *(.gnu.linkonce.wi.*) }
210   .debug_abbrev   0     : { *(.debug_abbrev) }
211   .debug_line     0     : { *(.debug_line) }
212   .debug_frame    0     : { *(.debug_frame) }
213   .debug_str      0     : { *(.debug_str) }
214   .debug_loc      0     : { *(.debug_loc) }
215   .debug_macinfo  0     : { *(.debug_macinfo) }
216
217   /* SGI/MIPS DWARF 2 extensions.  */
218   .debug_weaknames 0    : { *(.debug_weaknames) }
219   .debug_funcnames 0    : { *(.debug_funcnames) }
220   .debug_typenames 0    : { *(.debug_typenames) }
221   .debug_varnames  0    : { *(.debug_varnames) }
222
223   /* User stack.  */
224   .stack 0x200000       :
225   {
226         ${RELOCATING+__stack = .;}
227         *(.stack)
228   }
229 }
230 EOF