source: rtems/c/src/lib/libbsp/i386/pc386/startup/linkcmds @ 9c9e7a4

4.115
Last change on this file since 9c9e7a4 was bb08c0c8, checked in by Jennifer Averett <jennifer.averett@…>, on 05/30/12 at 18:10:43

pc386: Added sections for rtems-libbsd support.

  • Property mode set to 100644
File size: 8.5 KB
Line 
1/*
2 *  Copy of default "default linker script, for normal executables"
3 *  provided with binutils 2.18 with minor modifications for use
4 *  as pc386 linkcmds.  These changes include:
5 *
6 *    + sections commented out marked with "XXX commented out --joel"
7 *    + addition of m_hdr section
8 *    + addition of FreeBSD sysctl sections
9 */
10
11/*
12 * XXX commented out --joel
13OUTPUT_FORMAT("elf32-i386", "elf32-i386",
14              "elf32-i386")
15OUTPUT_ARCH(i386)
16ENTRY(_start)
17*/
18HeapSize = DEFINED(HeapSize) ? HeapSize :
19          DEFINED(_HeapSize) ? _HeapSize : 0x0;
20RamSize = DEFINED(RamSize) ? RamSize    :
21          DEFINED(_RamSize) ? _RamSize : 0xFFFFFFFF;
22
23SECTIONS
24{
25  /* Read-only sections, merged into text segment: */
26/*
27 * XXX commented out --joel
28  PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
29*/
30  .interp         : { *(.interp) }
31  .note.gnu.build-id : { *(.note.gnu.build-id) }
32  .hash           : { *(.hash) }
33  .gnu.hash       : { *(.gnu.hash) }
34  .dynsym         : { *(.dynsym) }
35  .dynstr         : { *(.dynstr) }
36  .gnu.version    : { *(.gnu.version) }
37  .gnu.version_d  : { *(.gnu.version_d) }
38  .gnu.version_r  : { *(.gnu.version_r) }
39  .rel.init       : { *(.rel.init) }
40  .rela.init      : { *(.rela.init) }
41  .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
42  .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
43  .rel.fini       : { *(.rel.fini) }
44  .rela.fini      : { *(.rela.fini) }
45  .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
46  .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
47  .rel.data.rel.ro   : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
48  .rela.data.rel.ro   : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
49  .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
50  .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
51  .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
52  .rela.tdata     : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
53  .rel.tbss       : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
54  .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
55  .rel.ctors      : { *(.rel.ctors) }
56  .rela.ctors     : { *(.rela.ctors) }
57  .rel.dtors      : { *(.rel.dtors) }
58  .rela.dtors     : { *(.rela.dtors) }
59  .rel.got        : { *(.rel.got) }
60  .rela.got       : { *(.rela.got) }
61  .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
62  .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
63  .rel.plt        : { *(.rel.plt) }
64  .rela.plt       : { *(.rela.plt) }
65  .plt            : { *(.plt) }
66  .text           :
67  {
68   *(.m_hdr)
69    *(.text .stub .text.* .gnu.linkonce.t.*)
70    KEEP (*(.text.*personality*))
71    /* .gnu.warning sections are handled specially by elf32.em.  */
72    *(.gnu.warning)
73    /*
74     * Special FreeBSD sysctl sections.
75     */
76    . = ALIGN (16);
77    __start_set_sysctl_set = .;
78    *(set_sysctl_*);
79    __stop_set_sysctl_set = ABSOLUTE(.);
80    *(set_domain_*);
81    *(set_pseudo_*);
82    _bsd__start_set_modmetadata_set = .;
83    *(_bsd_set_modmetadata_set);
84    _bsd__stop_set_modmetadata_set = .;
85    _bsd__start_set_sysctl_set = .;
86    *(_bsd_set_sysctl_set);
87    _bsd__stop_set_sysctl_set = .;
88    _bsd__start_set_sysinit_set = .;
89    *(_bsd_set_sysinit_*);
90    _bsd__stop_set_sysinit_set = .;
91
92    bsp_section_rodata_end = .;
93
94  } =0x90909090
95
96  .init           :
97  {
98    KEEP (*(.init))
99  } =0x90909090
100  .fini           :
101  {
102    KEEP (*(.fini))
103  } =0x90909090
104  PROVIDE (__etext = .);
105  PROVIDE (_etext = .);
106  PROVIDE (etext = .);
107  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
108  .rodata1        : { *(.rodata1) }
109  .eh_frame_hdr : { *(.eh_frame_hdr) }
110  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
111  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
112  /* Adjust the address for the data segment.  We want to adjust up to
113     the same address within the page on the next page up.  */
114  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
115  /* Exception handling  */
116  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
117  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
118  /* Thread Local Storage sections  */
119  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
120  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
121  .preinit_array     :
122  {
123    PROVIDE_HIDDEN (__preinit_array_start = .);
124    KEEP (*(.preinit_array))
125    PROVIDE_HIDDEN (__preinit_array_end = .);
126  }
127  .init_array     :
128  {
129     PROVIDE_HIDDEN (__init_array_start = .);
130     KEEP (*(SORT(.init_array.*)))
131     KEEP (*(.init_array))
132     PROVIDE_HIDDEN (__init_array_end = .);
133  }
134  .fini_array     :
135  {
136    PROVIDE_HIDDEN (__fini_array_start = .);
137    KEEP (*(.fini_array))
138    KEEP (*(SORT(.fini_array.*)))
139    PROVIDE_HIDDEN (__fini_array_end = .);
140  }
141  .ctors          :
142  {
143    /* gcc uses crtbegin.o to find the start of
144       the constructors, so we make sure it is
145       first.  Because this is a wildcard, it
146       doesn't matter if the user does not
147       actually link against crtbegin.o; the
148       linker won't look for a file to match a
149       wildcard.  The wildcard also means that it
150       doesn't matter which directory crtbegin.o
151       is in.  */
152    KEEP (*crtbegin.o(.ctors))
153    KEEP (*crtbegin?.o(.ctors))
154    /* We don't want to include the .ctor section from
155       the crtend.o file until after the sorted ctors.
156       The .ctor section from the crtend file contains the
157       end of ctors marker and it must be last */
158    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
159    KEEP (*(SORT(.ctors.*)))
160    KEEP (*(.ctors))
161  }
162  .dtors          :
163  {
164    KEEP (*crtbegin.o(.dtors))
165    KEEP (*crtbegin?.o(.dtors))
166    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
167    KEEP (*(SORT(.dtors.*)))
168    KEEP (*(.dtors))
169  }
170  .jcr            : { KEEP (*(.jcr)) }
171  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
172  .dynamic        : { *(.dynamic) }
173  .got            : { *(.got) }
174  . = DATA_SEGMENT_RELRO_END (12, .);
175  .got.plt        : { *(.got.plt) }
176  .data           :
177  {
178    *(.data .data.* .gnu.linkonce.d.*)
179    KEEP (*(.gnu.linkonce.d.*personality*))
180    SORT(CONSTRUCTORS)
181  }
182  .data1          : { *(.data1) }
183  _edata = .; PROVIDE (edata = .);
184  __bss_start = .;
185  .bss            :
186  {
187   *(.dynbss)
188   *(.bss .bss.* .gnu.linkonce.b.*)
189   *(COMMON)
190   /* Align here to ensure that the .bss section occupies space up to
191      _end.  Align after .bss to ensure correct alignment even if the
192      .bss section disappears because there are no input sections.
193      FIXME: Why do we need it? When there is no .bss section, we don't
194      pad the .data section.  */
195   . = ALIGN(. != 0 ? 32 / 8 : 1);
196  }
197  . = ALIGN(32 / 8);
198  . = ALIGN(32 / 8);
199  _end = .; PROVIDE (end = .);
200  . = ALIGN(0x10);
201  WorkAreaBase = .;
202  . = DATA_SEGMENT_END (.);
203
204  /* Stabs debugging sections.  */
205  .stab          0 : { *(.stab) }
206  .stabstr       0 : { *(.stabstr) }
207  .stab.excl     0 : { *(.stab.excl) }
208  .stab.exclstr  0 : { *(.stab.exclstr) }
209  .stab.index    0 : { *(.stab.index) }
210  .stab.indexstr 0 : { *(.stab.indexstr) }
211  .comment       0 : { *(.comment) }
212  /* DWARF debug sections.
213     Symbols in the DWARF debugging sections are relative to the beginning
214     of the section so we begin them at 0.  */
215  /* DWARF 1 */
216  .debug          0 : { *(.debug) }
217  .line           0 : { *(.line) }
218  /* GNU DWARF 1 extensions */
219  .debug_srcinfo  0 : { *(.debug_srcinfo) }
220  .debug_sfnames  0 : { *(.debug_sfnames) }
221  /* DWARF 1.1 and DWARF 2 */
222  .debug_aranges  0 : { *(.debug_aranges) }
223  .debug_pubnames 0 : { *(.debug_pubnames) }
224  /* DWARF 2 */
225  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
226  .debug_abbrev   0 : { *(.debug_abbrev) }
227  .debug_line     0 : { *(.debug_line) }
228  .debug_frame    0 : { *(.debug_frame) }
229  .debug_str      0 : { *(.debug_str) }
230  .debug_loc      0 : { *(.debug_loc) }
231  .debug_macinfo  0 : { *(.debug_macinfo) }
232  /* SGI/MIPS DWARF 2 extensions */
233  .debug_weaknames 0 : { *(.debug_weaknames) }
234  .debug_funcnames 0 : { *(.debug_funcnames) }
235  .debug_typenames 0 : { *(.debug_typenames) }
236  .debug_varnames  0 : { *(.debug_varnames) }
237  /* DWARF 3 */
238  .debug_pubtypes 0 : { *(.debug_pubtypes) }
239  .debug_ranges   0 : { *(.debug_ranges) }
240  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
241  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
242}
Note: See TracBrowser for help on using the repository browser.