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