source: trunk/libs/newlib/src/libgloss/mips/cfe.ld @ 496

Last change on this file since 496 was 444, checked in by satin@…, 7 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 4.0 KB
RevLine 
[444]1/* The following TEXT start address leaves space for the monitor
2   workspace. */
3
4ENTRY(_start)
5STARTUP(crt0_cfe.o)
6OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips")
7GROUP(-lc -lcfe -lgcc)
8SEARCH_DIR(.)
9__DYNAMIC  =  0;
10
11/*
12 * Allocate the stack to be at the top of memory, since the stack
13 * grows down
14 */
15PROVIDE (__stack = 0);
16/* PROVIDE (__global = 0); */
17
18/*
19 * Initalize some symbols to be zero so we can reference them in the
20 * crt0 without core dumping. These functions are all optional, but
21 * we do this so we can have our crt0 always use them if they exist.
22 * This is so BSPs work better when using the crt0 installed with gcc.
23 * We have to initalize them twice, so we multiple object file
24 * formats, as some prepend an underscore.
25 */
26PROVIDE (hardware_exit_hook = 0);
27PROVIDE (hardware_hazard_hook = 0);
28PROVIDE (hardware_init_hook = 0);
29PROVIDE (software_init_hook = 0);
30
31SECTIONS
32{       
33  . = 0x80020000;
34  .text : {
35    _ftext = . ;
36    PROVIDE (eprol = .);
37    *(.text)
38    *(.text.*)
39    *(.gnu.linkonce.t.*)
40    *(.mips16.fn.*)
41    *(.mips16.call.*)
42  }
43  .init : {
44    KEEP (*(.init))
45  }
46  .fini : {
47    KEEP (*(.fini))
48  }
49  .rel.sdata : {
50    PROVIDE (__runtime_reloc_start = .);
51    *(.rel.sdata)
52    PROVIDE (__runtime_reloc_stop = .);
53  }
54  PROVIDE (etext = .);
55  _etext  =  .;
56 
57  .eh_frame_hdr : { *(.eh_frame_hdr) }
58  .eh_frame : { KEEP (*(.eh_frame)) }
59  .gcc_except_table : { *(.gcc_except_table) }
60  .jcr : { KEEP (*(.jcr)) }
61  .ctors    :
62  {
63    /* gcc uses crtbegin.o to find the start of
64       the constructors, so we make sure it is
65       first.  Because this is a wildcard, it
66       doesn't matter if the user does not
67       actually link against crtbegin.o; the
68       linker won't look for a file to match a
69       wildcard.  The wildcard also means that it
70       doesn't matter which directory crtbegin.o
71       is in.  */
72
73    KEEP (*crtbegin.o(.ctors))
74
75    /* We don't want to include the .ctor section from
76       from the crtend.o file until after the sorted ctors.
77       The .ctor section from the crtend file contains the
78       end of ctors marker and it must be last */
79
80    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
81    KEEP (*(SORT(.ctors.*)))
82    KEEP (*(.ctors))
83  }
84
85  .dtors    :
86  {
87    KEEP (*crtbegin.o(.dtors))
88    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
89    KEEP (*(SORT(.dtors.*)))
90    KEEP (*(.dtors))
91  }
92
93  . = .;
94  .rodata : {
95    *(.rdata)
96    *(.rodata)
97    *(.rodata.*)
98    *(.gnu.linkonce.r.*)
99  }
100   _fdata = ALIGN(16);
101  .data : {
102    *(.data)
103    *(.data.*)
104    *(.gnu.linkonce.d.*)
105  }
106  . = ALIGN(8);
107  _gp = . + 0x8000;
108  __global = _gp;
109  .lit8 : {
110    *(.lit8)
111  }
112  .lit4 : {
113    *(.lit4)
114  }
115  .sdata : {
116    *(.sdata)
117    *(.sdata.*)
118    *(.gnu.linkonce.s.*)
119  }
120  . = ALIGN(4);
121   PROVIDE (edata  =  .);
122   _edata  =  .;
123   _fbss = .;
124  .sbss : {
125    *(.sbss)
126    *(.sbss.*)
127    *(.gnu.linkonce.sb.*)
128    *(.scommon)
129  }
130  .bss : {
131    _bss_start = . ;
132    *(.bss)
133    *(.bss.*)
134    *(.gnu.linkonce.b.*)
135    *(COMMON)
136  }
137
138  . = ALIGN(32);
139  PROVIDE (end = .);
140  _end = .;
141
142  /* DWARF debug sections.
143     Symbols in the DWARF debugging sections are relative to
144     the beginning of the section so we begin them at 0.  */
145
146  /* DWARF 1 */
147  .debug          0 : { *(.debug) }
148  .line           0 : { *(.line) }
149
150  /* GNU DWARF 1 extensions */
151  .debug_srcinfo  0 : { *(.debug_srcinfo) }
152  .debug_sfnames  0 : { *(.debug_sfnames) }
153
154  /* DWARF 1.1 and DWARF 2 */
155  .debug_aranges  0 : { *(.debug_aranges) }
156  .debug_pubnames 0 : { *(.debug_pubnames) }
157
158  /* DWARF 2 */
159  .debug_info     0 : { *(.debug_info) }
160  .debug_abbrev   0 : { *(.debug_abbrev) }
161  .debug_line     0 : { *(.debug_line) }
162  .debug_frame    0 : { *(.debug_frame) }
163  .debug_str      0 : { *(.debug_str) }
164  .debug_loc      0 : { *(.debug_loc) }
165  .debug_macinfo  0 : { *(.debug_macinfo) }
166  .debug_ranges   0 : { *(.debug_ranges) }
167
168  /* SGI/MIPS DWARF 2 extensions */
169  .debug_weaknames 0 : { *(.debug_weaknames) }
170  .debug_funcnames 0 : { *(.debug_funcnames) }
171  .debug_typenames 0 : { *(.debug_typenames) }
172  .debug_varnames  0 : { *(.debug_varnames) }
173}
Note: See TracBrowser for help on using the repository browser.