]>
Commit | Line | Data |
---|---|---|
ce823bab JJ |
1 | /* The following TEXT start address leaves space for the monitor |
2 | workspace. */ | |
3 | ||
4 | ENTRY(_prestart) | |
710c0fc4 | 5 | STARTUP(crt0.o) |
ce823bab JJ |
6 | OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips") |
7 | GROUP(-lc -lcfe -lgcc) | |
8 | SEARCH_DIR(.) | |
9 | __DYNAMIC = 0; | |
10 | ||
11 | /* | |
12 | * Allocate the stack to be at the top of memory, since the stack | |
13 | * grows down | |
14 | */ | |
15 | PROVIDE (__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 | */ | |
26 | PROVIDE (hardware_exit_hook = 0); | |
27 | PROVIDE (hardware_hazard_hook = 0); | |
28 | PROVIDE (hardware_init_hook = 0); | |
29 | PROVIDE (software_init_hook = 0); | |
30 | ||
31 | SECTIONS | |
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 | *(.init) | |
45 | } | |
46 | .fini : { | |
47 | *(.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 | .ctors : | |
58 | { | |
59 | /* gcc uses crtbegin.o to find the start of | |
60 | the constructors, so we make sure it is | |
61 | first. Because this is a wildcard, it | |
62 | doesn't matter if the user does not | |
63 | actually link against crtbegin.o; the | |
64 | linker won't look for a file to match a | |
65 | wildcard. The wildcard also means that it | |
66 | doesn't matter which directory crtbegin.o | |
67 | is in. */ | |
68 | ||
69 | KEEP (*crtbegin.o(.ctors)) | |
70 | ||
71 | /* We don't want to include the .ctor section from | |
72 | from the crtend.o file until after the sorted ctors. | |
73 | The .ctor section from the crtend file contains the | |
74 | end of ctors marker and it must be last */ | |
75 | ||
76 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) | |
77 | KEEP (*(SORT(.ctors.*))) | |
78 | KEEP (*(.ctors)) | |
79 | } | |
80 | ||
81 | .dtors : | |
82 | { | |
83 | KEEP (*crtbegin.o(.dtors)) | |
84 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) | |
85 | KEEP (*(SORT(.dtors.*))) | |
86 | KEEP (*(.dtors)) | |
87 | } | |
88 | ||
89 | . = .; | |
90 | .rodata : { | |
91 | *(.rdata) | |
92 | *(.rodata) | |
93 | *(.rodata.*) | |
94 | *(.gnu.linkonce.r*) | |
95 | } | |
96 | _fdata = ALIGN(16); | |
97 | .data : { | |
98 | *(.data) | |
99 | *(.data.*) | |
100 | *(.gnu.linkonce.d*) | |
101 | } | |
102 | . = ALIGN(8); | |
103 | _gp = . + 0x8000; | |
104 | __global = _gp; | |
105 | .lit8 : { | |
106 | *(.lit8) | |
107 | } | |
108 | .lit4 : { | |
109 | *(.lit4) | |
110 | } | |
111 | .sdata : { | |
112 | *(.sdata) | |
113 | *(.sdata.*) | |
114 | *(.gnu.linkonce.s*) | |
115 | } | |
116 | . = ALIGN(4); | |
117 | PROVIDE (edata = .); | |
118 | _edata = .; | |
119 | _fbss = .; | |
120 | .sbss : { | |
121 | *(.sbss) | |
122 | *(.scommon) | |
123 | } | |
124 | .bss : { | |
125 | _bss_start = . ; | |
126 | *(.bss) | |
127 | *(COMMON) | |
128 | } | |
129 | ||
130 | PROVIDE (end = .); | |
131 | _end = .; | |
132 | ||
133 | /* DWARF debug sections. | |
134 | Symbols in the DWARF debugging sections are relative to | |
135 | the beginning of the section so we begin them at 0. */ | |
136 | ||
137 | /* DWARF 1 */ | |
138 | .debug 0 : { *(.debug) } | |
139 | .line 0 : { *(.line) } | |
140 | ||
141 | /* GNU DWARF 1 extensions */ | |
142 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | |
143 | .debug_sfnames 0 : { *(.debug_sfnames) } | |
144 | ||
145 | /* DWARF 1.1 and DWARF 2 */ | |
146 | .debug_aranges 0 : { *(.debug_aranges) } | |
147 | .debug_pubnames 0 : { *(.debug_pubnames) } | |
148 | ||
149 | /* DWARF 2 */ | |
150 | .debug_info 0 : { *(.debug_info) } | |
151 | .debug_abbrev 0 : { *(.debug_abbrev) } | |
152 | .debug_line 0 : { *(.debug_line) } | |
153 | .debug_frame 0 : { *(.debug_frame) } | |
154 | .debug_str 0 : { *(.debug_str) } | |
155 | .debug_loc 0 : { *(.debug_loc) } | |
156 | .debug_macinfo 0 : { *(.debug_macinfo) } | |
157 | ||
158 | /* SGI/MIPS DWARF 2 extensions */ | |
159 | .debug_weaknames 0 : { *(.debug_weaknames) } | |
160 | .debug_funcnames 0 : { *(.debug_funcnames) } | |
161 | .debug_typenames 0 : { *(.debug_typenames) } | |
162 | .debug_varnames 0 : { *(.debug_varnames) } | |
163 | } |