2001-04-01 David O'Brien <obrien@FreeBSD.org>
[binutils.git] / ld / scripttempl / v850.sc
blob90731de8749470af2987944e96e1e1156a252431
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
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.  */
12   .zdata ${ZDATA_START_ADDR} :
13   {
14         *(.zdata)
15         *(.zbss)
16         *(reszdata)
17         *(.zcommon)
18   }
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.  */
26   .rozdata ${ROZDATA_START_ADDR} :
27   {
28         *(.rozdata)
29         *(romzdata)
30         *(romzbss)
31   }
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.got      : { *(.rel.got) }
46   .rela.got     : { *(.rela.got) }
47   .rel.ctors    : { *(.rel.ctors) }
48   .rela.ctors   : { *(.rela.ctors) }
49   .rel.dtors    : { *(.rel.dtors) }
50   .rela.dtors   : { *(.rela.dtors) }
51   .rel.init     : { *(.rel.init) }
52   .rela.init    : { *(.rela.init) }
53   .rel.fini     : { *(.rel.fini) }
54   .rela.fini    : { *(.rela.fini) }
55   .rel.bss      : { *(.rel.bss) }
56   .rela.bss     : { *(.rela.bss) }
57   .rel.plt      : { *(.rel.plt) }
58   .rela.plt     : { *(.rela.plt) }
59   .init         : { KEEP (*(.init)) } =0
60   .plt          : { *(.plt) }
62   .text         :
63   {
64     *(.text)
65     ${RELOCATING+*(.text.*)}
66     
67     /* .gnu.warning sections are handled specially by elf32.em.  */
68     *(.gnu.warning)
69     *(.gnu.linkonce.t*)
70   } =0
72   ${RELOCATING+_etext = .;}
73   ${RELOCATING+PROVIDE (etext = .);}
75    /* This is special code area at the end of the normal text section.
76       It contains a small lookup table at the start followed by the
77       code pointed to by entries in the lookup table.  */
79   .call_table_data ${CALL_TABLE_START_ADDR} :
80   {
81     ${RELOCATING+PROVIDE(__ctbp = .);}
82     *(.call_table_data)
83   } = 0xff   /* Fill gaps with 0xff.  */
84   
85   .call_table_text :
86   {
87     *(.call_table_text)
88   }
90   .fini         : { KEEP (*(.fini)) } =0
91   .rodata       : { *(.rodata) ${RELOCATING+*(.rodata.*)} *(.gnu.linkonce.r*) }
92   .rodata1      : { *(.rodata1) }
94   .data         :
95   {
96     *(.data)
97     ${RELOCATING+*(.data.*)}
98     *(.gnu.linkonce.d*)
99     CONSTRUCTORS
100   }
101   .data1        : { *(.data1) }
102   .ctors        :
103   {
104     ${CONSTRUCTING+___ctors = .;}
105     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
106     KEEP (*(SORT(.ctors.*)))
107     KEEP (*crtend(.ctors))
108     ${CONSTRUCTING+___ctors_end = .;}
109   }
110   .dtors        :
111   {
112     ${CONSTRUCTING+___dtors = .;}
113     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
114     KEEP (*(SORT(.dtors.*)))
115     KEEP (*crtend.o(.dtors))
116     ${CONSTRUCTING+___dtors_end = .;}
117   }
119   .got          : { *(.got.plt) *(.got) }
120   .dynamic      : { *(.dynamic) }
122   .tdata ${TDATA_START_ADDR} :
123   {
124         ${RELOCATING+PROVIDE (__ep = .);}
125         *(.tbyte)
126         *(.tcommon_byte)
127         *(.tdata)
128         *(.tbss)
129         *(.tcommon)
130   }
132   /* We want the small data sections together, so single-instruction offsets
133      can access them all, and initialized data all before uninitialized, so
134      we can shorten the on-disk segment size.  */
135      
136   .sdata ${SDATA_START_ADDR} :
137   {
138         ${RELOCATING+PROVIDE (__gp = . + 0x8000);}
139         *(.sdata)
140    }
142   /* See comment about .rozdata. */
143   .rosdata ${ROSDATA_START_ADDR} :
144   {
145         *(.rosdata)
146   }
148   /* We place the .sbss data section AFTER the .rosdata section, so that
149      it can directly preceed the .bss section.  This allows runtime startup
150      code to initialise all the zero-data sections by simply taking the
151      value of '_edata' and zeroing until it reaches '_end'.  */
152      
153   .sbss :
154   {
155         ${RELOCATING+__sbss_start = .;}
156         *(.sbss)
157         *(.scommon)
158   }
160   ${RELOCATING+_edata  = DEFINED (__sbss_start) ? __sbss_start : . ;}
161   ${RELOCATING+PROVIDE (edata = _edata);}
163   .bss       :
164   {
165         ${RELOCATING+__bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;}
166         ${RELOCATING+__real_bss_start = . ;}
167         *(.dynbss)
168         *(.bss)
169         *(COMMON)
170   }
172   ${RELOCATING+_end = . ;}
173   ${RELOCATING+PROVIDE (end = .);}
175   /* Stabs debugging sections.  */
176   .stab 0               : { *(.stab) }
177   .stabstr 0            : { *(.stabstr) }
178   .stab.excl 0          : { *(.stab.excl) }
179   .stab.exclstr 0       : { *(.stab.exclstr) }
180   .stab.index 0         : { *(.stab.index) }
181   .stab.indexstr 0      : { *(.stab.indexstr) }
182   .comment 0            : { *(.comment) }
184   /* DWARF debug sections.
185      Symbols in the DWARF debugging sections are relative to the beginning
186      of the section so we begin them at 0.  */
188   /* DWARF 1 */
189   .debug          0     : { *(.debug) }
190   .line           0     : { *(.line) }
192   /* GNU DWARF 1 extensions */
193   .debug_srcinfo  0     : { *(.debug_srcinfo) }
194   .debug_sfnames  0     : { *(.debug_sfnames) }
196   /* DWARF 1.1 and DWARF 2 */
197   .debug_aranges  0     : { *(.debug_aranges) }
198   .debug_pubnames 0     : { *(.debug_pubnames) }
200   /* DWARF 2 */
201   .debug_info     0     : { *(.debug_info) *(.gnu.linkonce.wi.*) }
202   .debug_abbrev   0     : { *(.debug_abbrev) }
203   .debug_line     0     : { *(.debug_line) }
204   .debug_frame    0     : { *(.debug_frame) }
205   .debug_str      0     : { *(.debug_str) }
206   .debug_loc      0     : { *(.debug_loc) }
207   .debug_macinfo  0     : { *(.debug_macinfo) }
209   /* SGI/MIPS DWARF 2 extensions.  */
210   .debug_weaknames 0    : { *(.debug_weaknames) }
211   .debug_funcnames 0    : { *(.debug_funcnames) }
212   .debug_typenames 0    : { *(.debug_typenames) }
213   .debug_varnames  0    : { *(.debug_varnames) }
215   /* User stack.  */
216   .stack 0x200000       :
217   {
218         ${RELOCATING+__stack = .;}
219         *(.stack)
220   }