]>
Commit | Line | Data |
---|---|---|
03261851 RK |
1 | /* The following TEXT start address leaves space for the monitor |
2 | workspace. i.e. the NEC VR4300 (IDT) first free address is actually | |
3 | 0xa001af20. */ | |
4 | ||
5 | ENTRY(_start) | |
6 | OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips") | |
7 | GROUP(-lc -lidt -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_init_hook = 0); | |
27 | PROVIDE (software_init_hook = 0); | |
28 | ||
29 | SECTIONS | |
30 | { | |
31 | . = 0xA0020000; | |
32 | .text : { | |
d9204f54 EC |
33 | _ftext = . ; |
34 | PROVIDE (eprol = .); | |
03261851 RK |
35 | *(.text) |
36 | *(.text.*) | |
37 | *(.gnu.linkonce.t*) | |
38 | *(.mips16.fn.*) | |
39 | *(.mips16.call.*) | |
d9204f54 EC |
40 | } |
41 | .init : { | |
42 | *(.init) | |
43 | } | |
44 | .fini : { | |
45 | *(.fini) | |
46 | } | |
47 | .rel.sdata : { | |
03261851 RK |
48 | PROVIDE (__runtime_reloc_start = .); |
49 | *(.rel.sdata) | |
50 | PROVIDE (__runtime_reloc_stop = .); | |
03261851 | 51 | } |
d9204f54 EC |
52 | PROVIDE (etext = .); |
53 | _etext = .; | |
03261851 RK |
54 | |
55 | .ctors : | |
56 | { | |
57 | /* gcc uses crtbegin.o to find the start of | |
58 | the constructors, so we make sure it is | |
59 | first. Because this is a wildcard, it | |
60 | doesn't matter if the user does not | |
61 | actually link against crtbegin.o; the | |
62 | linker won't look for a file to match a | |
63 | wildcard. The wildcard also means that it | |
64 | doesn't matter which directory crtbegin.o | |
65 | is in. */ | |
66 | ||
67 | KEEP (*crtbegin.o(.ctors)) | |
68 | ||
69 | /* We don't want to include the .ctor section from | |
70 | from the crtend.o file until after the sorted ctors. | |
71 | The .ctor section from the crtend file contains the | |
72 | end of ctors marker and it must be last */ | |
73 | ||
74 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) | |
75 | KEEP (*(SORT(.ctors.*))) | |
76 | KEEP (*(.ctors)) | |
77 | } | |
78 | ||
79 | .dtors : | |
80 | { | |
81 | KEEP (*crtbegin.o(.dtors)) | |
82 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) | |
83 | KEEP (*(SORT(.dtors.*))) | |
84 | KEEP (*(.dtors)) | |
85 | } | |
86 | ||
87 | . = .; | |
88 | .rodata : { | |
89 | *(.rdata) | |
90 | *(.rodata) | |
91 | *(.rodata.*) | |
92 | *(.gnu.linkonce.r*) | |
93 | } | |
94 | _fdata = ALIGN(16); | |
95 | .data : { | |
96 | *(.data) | |
97 | *(.data.*) | |
98 | *(.gnu.linkonce.d*) | |
99 | } | |
100 | . = ALIGN(8); | |
101 | _gp = . + 0x8000; | |
102 | __global = _gp; | |
103 | .lit8 : { | |
104 | *(.lit8) | |
105 | } | |
106 | .lit4 : { | |
107 | *(.lit4) | |
108 | } | |
109 | .sdata : { | |
110 | *(.sdata) | |
111 | *(.sdata.*) | |
112 | *(.gnu.linkonce.s*) | |
113 | } | |
114 | . = ALIGN(4); | |
d9204f54 | 115 | PROVIDE (edata = .); |
03261851 RK |
116 | _edata = .; |
117 | _fbss = .; | |
118 | .sbss : { | |
119 | *(.sbss) | |
120 | *(.scommon) | |
121 | } | |
122 | .bss : { | |
123 | _bss_start = . ; | |
124 | *(.bss) | |
125 | *(COMMON) | |
126 | } | |
127 | ||
d9204f54 EC |
128 | PROVIDE (end = .); |
129 | _end = .; | |
03261851 RK |
130 | |
131 | /* DWARF debug sections. | |
132 | Symbols in the DWARF debugging sections are relative to | |
133 | the beginning of the section so we begin them at 0. */ | |
134 | ||
135 | /* DWARF 1 */ | |
136 | .debug 0 : { *(.debug) } | |
137 | .line 0 : { *(.line) } | |
138 | ||
139 | /* GNU DWARF 1 extensions */ | |
140 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | |
141 | .debug_sfnames 0 : { *(.debug_sfnames) } | |
142 | ||
143 | /* DWARF 1.1 and DWARF 2 */ | |
144 | .debug_aranges 0 : { *(.debug_aranges) } | |
145 | .debug_pubnames 0 : { *(.debug_pubnames) } | |
146 | ||
147 | /* DWARF 2 */ | |
148 | .debug_info 0 : { *(.debug_info) } | |
149 | .debug_abbrev 0 : { *(.debug_abbrev) } | |
150 | .debug_line 0 : { *(.debug_line) } | |
151 | .debug_frame 0 : { *(.debug_frame) } | |
152 | .debug_str 0 : { *(.debug_str) } | |
153 | .debug_loc 0 : { *(.debug_loc) } | |
154 | .debug_macinfo 0 : { *(.debug_macinfo) } | |
155 | ||
156 | /* SGI/MIPS DWARF 2 extensions */ | |
157 | .debug_weaknames 0 : { *(.debug_weaknames) } | |
158 | .debug_funcnames 0 : { *(.debug_funcnames) } | |
159 | .debug_typenames 0 : { *(.debug_typenames) } | |
160 | .debug_varnames 0 : { *(.debug_varnames) } | |
161 | } |