1/* Script for ld --shared: link shared library */
2/* From binutils-2.19 */
3OUTPUT_FORMAT("elf32-sparc", "elf32-sparc",
4	      "elf32-sparc")
5OUTPUT_ARCH(sparc)
6ENTRY(_start)
7
8SECTIONS
9{
10  /* Read-only sections, merged into text segment: */
11  . = 0 + SIZEOF_HEADERS;
12  .note.gnu.build-id : { *(.note.gnu.build-id) }
13  .hash           : { *(.hash) }
14  .gnu.hash       : { *(.gnu.hash) }
15  .dynsym         : { *(.dynsym) }
16  .dynstr         : { *(.dynstr) }
17  .gnu.version    : { *(.gnu.version) }
18  .gnu.version_d  : { *(.gnu.version_d) }
19  .gnu.version_r  : { *(.gnu.version_r) }
20  .rel.dyn        :
21    {
22      *(.rel.init)
23      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
24      *(.rel.fini)
25      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
26      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
27      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
28      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
29      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
30      *(.rel.ctors)
31      *(.rel.dtors)
32      *(.rel.got)
33      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
34      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
35      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
36      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
37      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
38    }
39  .rela.dyn       :
40    {
41      *(.rela.init)
42      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
43      *(.rela.fini)
44      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
45      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
46      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
47      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
48      *(.rela.ctors)
49      *(.rela.dtors)
50      *(.rela.got)
51      *(.rela.got1)
52      *(.rela.got2)
53      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
54      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
55      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
56      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
57      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
58    }
59  .rel.plt        : { *(.rel.plt) }
60  .rela.plt       : { *(.rela.plt) }
61  .init           :
62  {
63    KEEP (*(.init))
64  } =0
65  .text           :
66  {
67    *(.text .stub .text.* .gnu.linkonce.t.*)
68    KEEP (*(.text.*personality*))
69    /* .gnu.warning sections are handled specially by elf32.em.  */
70    *(.gnu.warning)
71    *(.glink)
72  } =0
73  .fini           :
74  {
75    KEEP (*(.fini))
76  } =0
77  PROVIDE (__etext = .);
78  PROVIDE (_etext = .);
79  PROVIDE (etext = .);
80  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
81  .rodata1        : { *(.rodata1) }
82  .eh_frame_hdr : { *(.eh_frame_hdr) }
83  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
84  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
85  /* Adjust the address for the data segment.  We want to adjust up to
86     the same address within the page on the next page up.  */
87  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
88  /* Exception handling  */
89  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
90  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
91  /* Thread Local Storage sections  */
92  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
93  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
94  .preinit_array     :
95  {
96    KEEP (*(.preinit_array))
97  }
98  .init_array     :
99  {
100     KEEP (*(SORT(.init_array.*)))
101     KEEP (*(.init_array))
102  }
103  .fini_array     :
104  {
105    KEEP (*(.fini_array))
106    KEEP (*(SORT(.fini_array.*)))
107  }
108  .ctors          :
109  {
110    /* gcc uses crtbegin.o to find the start of
111       the constructors, so we make sure it is
112       first.  Because this is a wildcard, it
113       doesn't matter if the user does not
114       actually link against crtbegin.o; the
115       linker won't look for a file to match a
116       wildcard.  The wildcard also means that it
117       doesn't matter which directory crtbegin.o
118       is in.  */
119    KEEP (*crtbegin.o(.ctors))
120    KEEP (*crtbegin?.o(.ctors))
121    /* We don't want to include the .ctor section from
122       the crtend.o file until after the sorted ctors.
123       The .ctor section from the crtend file contains the
124       end of ctors marker and it must be last */
125    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
126    KEEP (*(SORT(.ctors.*)))
127    KEEP (*(.ctors))
128  }
129  .dtors          :
130  {
131    KEEP (*crtbegin.o(.dtors))
132    KEEP (*crtbegin?.o(.dtors))
133    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
134    KEEP (*(SORT(.dtors.*)))
135    KEEP (*(.dtors))
136  }
137  __DTOR_END__ = .;
138  .jcr            : { KEEP (*(.jcr)) }
139  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
140  .got1           : { *(.got1) }
141  .got2           : { *(.got2) }
142  .dynamic        : { *(.dynamic) }
143  .got            : SPECIAL { *(.got) }
144  . = DATA_SEGMENT_RELRO_END (0, .);
145  .plt            : SPECIAL { *(.plt) }
146  .data           :
147  {
148    *(.data .data.* .gnu.linkonce.d.*)
149    KEEP (*(.gnu.linkonce.d.*personality*))
150    SORT(CONSTRUCTORS)
151  }
152  .data1          : { *(.data1) }
153  .got            : SPECIAL { *(.got) }
154  /* We want the small data sections together, so single-instruction offsets
155     can access them all, and initialized data all before uninitialized, so
156     we can shorten the on-disk segment size.  */
157  .sdata          :
158  {
159    *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
160    *(.sdata .sdata.* .gnu.linkonce.s.*)
161  }
162  _edata = .; PROVIDE (edata = .);
163  __bss_start = .;
164  .sbss           :
165  {
166    *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
167    *(.dynsbss)
168    *(.sbss .sbss.* .gnu.linkonce.sb.*)
169    *(.scommon)
170  }
171  .plt            : SPECIAL { *(.plt) }
172  .bss            :
173  {
174   *(.dynbss)
175   *(.bss .bss.* .gnu.linkonce.b.*)
176   *(COMMON)
177   /* Align here to ensure that the .bss section occupies space up to
178      _end.  Align after .bss to ensure correct alignment even if the
179      .bss section disappears because there are no input sections.
180      FIXME: Why do we need it? When there is no .bss section, we don't
181      pad the .data section.  */
182   . = ALIGN(. != 0 ? 32 / 8 : 1);
183  }
184  . = ALIGN(32 / 8);
185  . = ALIGN(32 / 8);
186  _end = .; PROVIDE (end = .);
187  . = DATA_SEGMENT_END (.);
188  /* Stabs debugging sections.  */
189  .stab          0 : { *(.stab) }
190  .stabstr       0 : { *(.stabstr) }
191  .stab.excl     0 : { *(.stab.excl) }
192  .stab.exclstr  0 : { *(.stab.exclstr) }
193  .stab.index    0 : { *(.stab.index) }
194  .stab.indexstr 0 : { *(.stab.indexstr) }
195  .comment       0 : { *(.comment) }
196  /* DWARF debug sections.
197     Symbols in the DWARF debugging sections are relative to the beginning
198     of the section so we begin them at 0.  */
199  /* DWARF 1 */
200  .debug          0 : { *(.debug) }
201  .line           0 : { *(.line) }
202  /* GNU DWARF 1 extensions */
203  .debug_srcinfo  0 : { *(.debug_srcinfo) }
204  .debug_sfnames  0 : { *(.debug_sfnames) }
205  /* DWARF 1.1 and DWARF 2 */
206  .debug_aranges  0 : { *(.debug_aranges) }
207  .debug_pubnames 0 : { *(.debug_pubnames) }
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  /* SGI/MIPS DWARF 2 extensions */
217  .debug_weaknames 0 : { *(.debug_weaknames) }
218  .debug_funcnames 0 : { *(.debug_funcnames) }
219  .debug_typenames 0 : { *(.debug_typenames) }
220  .debug_varnames  0 : { *(.debug_varnames) }
221  /* DWARF 3 */
222  .debug_pubtypes 0 : { *(.debug_pubtypes) }
223  .debug_ranges   0 : { *(.debug_ranges) }
224  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
225  /DISCARD/	: { *(.fixup) }
226  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
227}
228