source: rtems/c/src/lib/libbsp/i386/pc386/startup/linkcmds @ 7b21633

4.104.115
Last change on this file since 7b21633 was ef37cb6, checked in by Joel Sherrill <joel.sherrill@…>, on 09/18/08 at 20:41:09

2008-09-18 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add bsp_get_work_area() implementation and use more of the BSP Initialization Framework.
  • startup/bspgetworkarea.c: New file.
  • Property mode set to 100644
File size: 8.1 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 *  $Id$
11 */
12
13/*
14 * XXX commented out --joel
15OUTPUT_FORMAT("elf32-i386", "elf32-i386",
16              "elf32-i386")
17OUTPUT_ARCH(i386)
18ENTRY(_start)
19*/
20HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
21RamSize = 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
83  } =0x90909090
84
85  .init           :
86  {
87    KEEP (*(.init))
88  } =0x90909090
89  .fini           :
90  {
91    KEEP (*(.fini))
92  } =0x90909090
93  PROVIDE (__etext = .);
94  PROVIDE (_etext = .);
95  PROVIDE (etext = .);
96  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
97  .rodata1        : { *(.rodata1) }
98  .eh_frame_hdr : { *(.eh_frame_hdr) }
99  .eh_frame       : ONLY_IF_RO { KEEP (*(.eh_frame)) }
100  .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
101  /* Adjust the address for the data segment.  We want to adjust up to
102     the same address within the page on the next page up.  */
103  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
104  /* Exception handling  */
105  .eh_frame       : ONLY_IF_RW { KEEP (*(.eh_frame)) }
106  .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
107  /* Thread Local Storage sections  */
108  .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
109  .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
110  .preinit_array     :
111  {
112    PROVIDE_HIDDEN (__preinit_array_start = .);
113    KEEP (*(.preinit_array))
114    PROVIDE_HIDDEN (__preinit_array_end = .);
115  }
116  .init_array     :
117  {
118     PROVIDE_HIDDEN (__init_array_start = .);
119     KEEP (*(SORT(.init_array.*)))
120     KEEP (*(.init_array))
121     PROVIDE_HIDDEN (__init_array_end = .);
122  }
123  .fini_array     :
124  {
125    PROVIDE_HIDDEN (__fini_array_start = .);
126    KEEP (*(.fini_array))
127    KEEP (*(SORT(.fini_array.*)))
128    PROVIDE_HIDDEN (__fini_array_end = .);
129  }
130  .ctors          :
131  {
132    /* gcc uses crtbegin.o to find the start of
133       the constructors, so we make sure it is
134       first.  Because this is a wildcard, it
135       doesn't matter if the user does not
136       actually link against crtbegin.o; the
137       linker won't look for a file to match a
138       wildcard.  The wildcard also means that it
139       doesn't matter which directory crtbegin.o
140       is in.  */
141    KEEP (*crtbegin.o(.ctors))
142    KEEP (*crtbegin?.o(.ctors))
143    /* We don't want to include the .ctor section from
144       the crtend.o file until after the sorted ctors.
145       The .ctor section from the crtend file contains the
146       end of ctors marker and it must be last */
147    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
148    KEEP (*(SORT(.ctors.*)))
149    KEEP (*(.ctors))
150  }
151  .dtors          :
152  {
153    KEEP (*crtbegin.o(.dtors))
154    KEEP (*crtbegin?.o(.dtors))
155    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
156    KEEP (*(SORT(.dtors.*)))
157    KEEP (*(.dtors))
158  }
159  .jcr            : { KEEP (*(.jcr)) }
160  .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
161  .dynamic        : { *(.dynamic) }
162  .got            : { *(.got) }
163  . = DATA_SEGMENT_RELRO_END (12, .);
164  .got.plt        : { *(.got.plt) }
165  .data           :
166  {
167    *(.data .data.* .gnu.linkonce.d.*)
168    KEEP (*(.gnu.linkonce.d.*personality*))
169    SORT(CONSTRUCTORS)
170  }
171  .data1          : { *(.data1) }
172  _edata = .; PROVIDE (edata = .);
173  __bss_start = .;
174  .bss            :
175  {
176   *(.dynbss)
177   *(.bss .bss.* .gnu.linkonce.b.*)
178   *(COMMON)
179   /* Align here to ensure that the .bss section occupies space up to
180      _end.  Align after .bss to ensure correct alignment even if the
181      .bss section disappears because there are no input sections.
182      FIXME: Why do we need it? When there is no .bss section, we don't
183      pad the .data section.  */
184   . = ALIGN(. != 0 ? 32 / 8 : 1);
185  }
186  . = ALIGN(32 / 8);
187  . = ALIGN(32 / 8);
188  _end = .; PROVIDE (end = .);
189  . = ALIGN(0x10);
190  WorkAreaBase = .;
191  . = DATA_SEGMENT_END (.);
192
193  /* Stabs debugging sections.  */
194  .stab          0 : { *(.stab) }
195  .stabstr       0 : { *(.stabstr) }
196  .stab.excl     0 : { *(.stab.excl) }
197  .stab.exclstr  0 : { *(.stab.exclstr) }
198  .stab.index    0 : { *(.stab.index) }
199  .stab.indexstr 0 : { *(.stab.indexstr) }
200  .comment       0 : { *(.comment) }
201  /* DWARF debug sections.
202     Symbols in the DWARF debugging sections are relative to the beginning
203     of the section so we begin them at 0.  */
204  /* DWARF 1 */
205  .debug          0 : { *(.debug) }
206  .line           0 : { *(.line) }
207  /* GNU DWARF 1 extensions */
208  .debug_srcinfo  0 : { *(.debug_srcinfo) }
209  .debug_sfnames  0 : { *(.debug_sfnames) }
210  /* DWARF 1.1 and DWARF 2 */
211  .debug_aranges  0 : { *(.debug_aranges) }
212  .debug_pubnames 0 : { *(.debug_pubnames) }
213  /* DWARF 2 */
214  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
215  .debug_abbrev   0 : { *(.debug_abbrev) }
216  .debug_line     0 : { *(.debug_line) }
217  .debug_frame    0 : { *(.debug_frame) }
218  .debug_str      0 : { *(.debug_str) }
219  .debug_loc      0 : { *(.debug_loc) }
220  .debug_macinfo  0 : { *(.debug_macinfo) }
221  /* SGI/MIPS DWARF 2 extensions */
222  .debug_weaknames 0 : { *(.debug_weaknames) }
223  .debug_funcnames 0 : { *(.debug_funcnames) }
224  .debug_typenames 0 : { *(.debug_typenames) }
225  .debug_varnames  0 : { *(.debug_varnames) }
226  /* DWARF 3 */
227  .debug_pubtypes 0 : { *(.debug_pubtypes) }
228  .debug_ranges   0 : { *(.debug_ranges) }
229  .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
230  /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) }
231}
Note: See TracBrowser for help on using the repository browser.