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

4.104.115
Last change on this file since 7f09abec was 3f432fbd, checked in by Joel Sherrill <joel.sherrill@…>, on 03/22/08 at 14:01:49

2008-03-22 Joel Sherrill <joel.sherrill@…>

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