1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * Based on jmr3904app-dram.ld from newlib 1.8.2 |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * Declare some sizes. |
---|
9 | */ |
---|
10 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x0; |
---|
11 | _RamSize = DEFINED(_RamSize) ? _RamSize : 1M; |
---|
12 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
13 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
14 | |
---|
15 | SECTIONS |
---|
16 | { |
---|
17 | . = 0x88000000; |
---|
18 | .text : |
---|
19 | { |
---|
20 | _ftext = . ; |
---|
21 | eprol = .; |
---|
22 | *(.text) |
---|
23 | *(.text.*) |
---|
24 | *(.gnu.linkonce.t*) |
---|
25 | *(.init) |
---|
26 | *(.mips16.fn.*) |
---|
27 | *(.mips16.call.*) |
---|
28 | PROVIDE (__runtime_reloc_start = .); |
---|
29 | *(.rel.sdata) |
---|
30 | PROVIDE (__runtime_reloc_stop = .); |
---|
31 | *(.fini) |
---|
32 | etext = .; |
---|
33 | _etext = .; |
---|
34 | } |
---|
35 | .ctors : |
---|
36 | { |
---|
37 | /* gcc uses crtbegin.o to find the start of |
---|
38 | the constructors, so we make sure it is |
---|
39 | first. Because this is a wildcard, it |
---|
40 | doesn't matter if the user does not |
---|
41 | actually link against crtbegin.o; the |
---|
42 | linker won't look for a file to match a |
---|
43 | wildcard. The wildcard also means that it |
---|
44 | doesn't matter which directory crtbegin.o |
---|
45 | is in. */ |
---|
46 | |
---|
47 | KEEP (*crtbegin.o(.ctors)) |
---|
48 | |
---|
49 | /* We don't want to include the .ctor section from |
---|
50 | from the crtend.o file until after the sorted ctors. |
---|
51 | The .ctor section from the crtend file contains the |
---|
52 | end of ctors marker and it must be last */ |
---|
53 | |
---|
54 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
---|
55 | KEEP (*(SORT(.ctors.*))) |
---|
56 | KEEP (*(.ctors)) |
---|
57 | } |
---|
58 | |
---|
59 | .dtors : |
---|
60 | { |
---|
61 | KEEP (*crtbegin.o(.dtors)) |
---|
62 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
---|
63 | KEEP (*(SORT(.dtors.*))) |
---|
64 | KEEP (*(.dtors)) |
---|
65 | } |
---|
66 | |
---|
67 | . = .; |
---|
68 | .rdata : { |
---|
69 | *(.rdata) |
---|
70 | *(.rodata) |
---|
71 | *(.rodata.*) |
---|
72 | *(.gnu.linkonce.r*) |
---|
73 | } |
---|
74 | _fdata = ALIGN(16); |
---|
75 | .data : { |
---|
76 | *(.data) |
---|
77 | *(.data.*) |
---|
78 | *(.gnu.linkonce.d*) |
---|
79 | SORT(CONSTRUCTORS) |
---|
80 | } |
---|
81 | . = ALIGN(8); |
---|
82 | _gp = . + 0x8000; |
---|
83 | __global = _gp; |
---|
84 | .lit8 : { |
---|
85 | *(.lit8) |
---|
86 | } |
---|
87 | .lit4 : { |
---|
88 | *(.lit4) |
---|
89 | } |
---|
90 | .sdata : { |
---|
91 | *(.sdata) |
---|
92 | *(.sdata.*) |
---|
93 | *(.gnu.linkonce.s*) |
---|
94 | } |
---|
95 | . = ALIGN(4); |
---|
96 | edata = .; |
---|
97 | _edata = .; |
---|
98 | _fbss = .; |
---|
99 | .sbss : { |
---|
100 | *(.sbss) |
---|
101 | *(.scommon) |
---|
102 | } |
---|
103 | .bss : { |
---|
104 | _bss_start = . ; |
---|
105 | *(.bss) |
---|
106 | *(COMMON) |
---|
107 | . = ALIGN (64); |
---|
108 | _stack_limit = .; |
---|
109 | . += _StackSize; |
---|
110 | __stack = .; |
---|
111 | _stack_init = .; |
---|
112 | HeapBase = .; |
---|
113 | . += HeapSize; /* reserve some memory for heap */ |
---|
114 | WorkspaceBase = .; |
---|
115 | /* HACK -- tied to value bspstart */ |
---|
116 | . += 4096K; /* reserve some memory for workspace */ |
---|
117 | _clear_end = .; |
---|
118 | } |
---|
119 | end = .; |
---|
120 | _end = .; |
---|
121 | |
---|
122 | |
---|
123 | /* Put starting stack in SRAM (8 Kb); this size is the same as the stack from |
---|
124 | the original script (when everything was in SRAM). */ |
---|
125 | /* __stack = 0x8000A000; */ |
---|
126 | /* DWARF debug sections. |
---|
127 | Symbols in the DWARF debugging sections are relative to |
---|
128 | the beginning of the section so we begin them at 0. */ |
---|
129 | |
---|
130 | /* DWARF 1 */ |
---|
131 | .debug 0 : { *(.debug) } |
---|
132 | .line 0 : { *(.line) } |
---|
133 | |
---|
134 | /* GNU DWARF 1 extensions */ |
---|
135 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
136 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
137 | |
---|
138 | /* DWARF 1.1 and DWARF 2 */ |
---|
139 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
140 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
141 | |
---|
142 | /* DWARF 2 */ |
---|
143 | .debug_info 0 : { *(.debug_info) } |
---|
144 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
145 | .debug_line 0 : { *(.debug_line) } |
---|
146 | .debug_frame 0 : { *(.debug_frame) } |
---|
147 | .debug_str 0 : { *(.debug_str) } |
---|
148 | .debug_loc 0 : { *(.debug_loc) } |
---|
149 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
150 | |
---|
151 | /* SGI/MIPS DWARF 2 extensions */ |
---|
152 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
153 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
154 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
155 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
156 | } |
---|