1 | /* The following TEXT start address leaves space for the monitor |
---|
2 | workspace. */ |
---|
3 | |
---|
4 | ENTRY(_start) |
---|
5 | STARTUP(crt0.o) |
---|
6 | OUTPUT_ARCH("mips:4000") |
---|
7 | OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-littlemips") |
---|
8 | GROUP(-lc -llsi -lgcc) |
---|
9 | SEARCH_DIR(.) |
---|
10 | __DYNAMIC = 0; |
---|
11 | |
---|
12 | /* |
---|
13 | * Allocate the stack to be at the top of memory, since the stack |
---|
14 | * grows down |
---|
15 | */ |
---|
16 | PROVIDE (__stack = 0); |
---|
17 | /* PROVIDE (__global = 0); */ |
---|
18 | |
---|
19 | /* |
---|
20 | * Initalize some symbols to be zero so we can reference them in the |
---|
21 | * crt0 without core dumping. These functions are all optional, but |
---|
22 | * we do this so we can have our crt0 always use them if they exist. |
---|
23 | * This is so BSPs work better when using the crt0 installed with gcc. |
---|
24 | * We have to initalize them twice, so we multiple object file |
---|
25 | * formats, as some prepend an underscore. |
---|
26 | */ |
---|
27 | PROVIDE (hardware_exit_hook = 0); |
---|
28 | PROVIDE (hardware_hazard_hook = 0); |
---|
29 | PROVIDE (hardware_init_hook = 0); |
---|
30 | PROVIDE (software_init_hook = 0); |
---|
31 | |
---|
32 | SECTIONS |
---|
33 | { |
---|
34 | . = 0xA0020000; |
---|
35 | .text : { |
---|
36 | _ftext = . ; |
---|
37 | KEEP (*(.init)) |
---|
38 | eprol = .; |
---|
39 | *(.text) |
---|
40 | *(.text.*) |
---|
41 | *(.gnu.linkonce.t.*) |
---|
42 | PROVIDE (__runtime_reloc_start = .); |
---|
43 | *(.rel.sdata) |
---|
44 | PROVIDE (__runtime_reloc_stop = .); |
---|
45 | KEEP (*(.fini)) |
---|
46 | etext = .; |
---|
47 | _etext = .; |
---|
48 | } |
---|
49 | |
---|
50 | .eh_frame_hdr : { *(.eh_frame_hdr) } |
---|
51 | .eh_frame : { KEEP (*(.eh_frame)) } |
---|
52 | .gcc_except_table : { *(.gcc_except_table) } |
---|
53 | .jcr : { KEEP (*(.jcr)) } |
---|
54 | .ctors : |
---|
55 | { |
---|
56 | /* gcc uses crtbegin.o to find the start of |
---|
57 | the constructors, so we make sure it is |
---|
58 | first. Because this is a wildcard, it |
---|
59 | doesn't matter if the user does not |
---|
60 | actually link against crtbegin.o; the |
---|
61 | linker won't look for a file to match a |
---|
62 | wildcard. The wildcard also means that it |
---|
63 | doesn't matter which directory crtbegin.o |
---|
64 | is in. */ |
---|
65 | |
---|
66 | KEEP (*crtbegin.o(.ctors)) |
---|
67 | |
---|
68 | /* We don't want to include the .ctor section from |
---|
69 | from the crtend.o file until after the sorted ctors. |
---|
70 | The .ctor section from the crtend file contains the |
---|
71 | end of ctors marker and it must be last */ |
---|
72 | |
---|
73 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
---|
74 | KEEP (*(SORT(.ctors.*))) |
---|
75 | KEEP (*(.ctors)) |
---|
76 | } |
---|
77 | |
---|
78 | .dtors : |
---|
79 | { |
---|
80 | KEEP (*crtbegin.o(.dtors)) |
---|
81 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
---|
82 | KEEP (*(SORT(.dtors.*))) |
---|
83 | KEEP (*(.dtors)) |
---|
84 | } |
---|
85 | |
---|
86 | . = .; |
---|
87 | .rodata : { |
---|
88 | *(.rdata) |
---|
89 | *(.rodata) |
---|
90 | *(.rodata.*) |
---|
91 | *(.gnu.linkonce.r.*) |
---|
92 | } |
---|
93 | _fdata = ALIGN(16); |
---|
94 | .data : { |
---|
95 | *(.data) |
---|
96 | *(.data.*) |
---|
97 | *(.gnu.linkonce.d.*) |
---|
98 | CONSTRUCTORS |
---|
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 | edata = .; |
---|
115 | _edata = .; |
---|
116 | _fbss = .; |
---|
117 | .sbss : { |
---|
118 | *(.sbss) |
---|
119 | *(.sbss.*) |
---|
120 | *(.gnu.linkonce.sb.*) |
---|
121 | *(.scommon) |
---|
122 | } |
---|
123 | .bss : { |
---|
124 | _bss_start = . ; |
---|
125 | *(.bss) |
---|
126 | *(.bss.*) |
---|
127 | *(.gnu.linkonce.b.*) |
---|
128 | *(COMMON) |
---|
129 | } |
---|
130 | end = .; |
---|
131 | _end = .; |
---|
132 | } |
---|