1 | /* Linker script for armulator
|
---|
2 | *
|
---|
3 | * Version: Sourcery G++ Lite 2009q3-68
|
---|
4 | * Support: https://support.codesourcery.com/GNUToolchain/
|
---|
5 | *
|
---|
6 | * Copyright (c) 2007, 2008, 2009 CodeSourcery, Inc.
|
---|
7 | *
|
---|
8 | * The authors hereby grant permission to use, copy, modify, distribute,
|
---|
9 | * and license this software and its documentation for any purpose, provided
|
---|
10 | * that existing copyright notices are retained in all copies and that this
|
---|
11 | * notice is included verbatim in any distributions. No written agreement,
|
---|
12 | * license, or royalty fee is required for any of the authorized uses.
|
---|
13 | * Modifications to this software may be copyrighted by their authors
|
---|
14 | * and need not follow the licensing terms described here, provided that
|
---|
15 | * the new terms are clearly indicated on the first page of each file where
|
---|
16 | * they apply.
|
---|
17 | * */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Modified for GCC ARM Embedded in Launchpad
|
---|
21 | * https://launchpad.net/gcc-arm-embedded
|
---|
22 | *
|
---|
23 | * Copyright (C) 2015 by Naoki Saito
|
---|
24 | * Nagoya Municipal Industrial Research Institute, JAPAN
|
---|
25 | *
|
---|
26 | */
|
---|
27 |
|
---|
28 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
---|
29 | SEARCH_DIR(.)
|
---|
30 | /* GROUP(-lgcc -lc -lcs3 -lcs3hosted -lcs3arm) */
|
---|
31 | PROVIDE(hardware_init_hook = 0);
|
---|
32 | PROVIDE(software_init_hook = 0);
|
---|
33 | PROVIDE(software_term_hook = 0);
|
---|
34 | STARTUP(start.o)
|
---|
35 |
|
---|
36 | MEMORY
|
---|
37 | {
|
---|
38 | ram (rwx) : ORIGIN = 0x0, LENGTH = 128M
|
---|
39 | }
|
---|
40 |
|
---|
41 | /* These force the linker to search for particular symbols from
|
---|
42 | * the start of the link process and thus ensure the user's
|
---|
43 | * overrides are picked up
|
---|
44 | */
|
---|
45 | /* EXTERN(__cs3_reset_armulator) */
|
---|
46 | /* INCLUDE arm-names.inc */
|
---|
47 | /* EXTERN(__cs3_interrupt_vector_arm) */
|
---|
48 | /* EXTERN(__cs3_start_c main __cs3_stack __cs3_heap_end) */
|
---|
49 | /* force exit to be picked up in a hosted or os environment */
|
---|
50 | EXTERN(exit atexit)
|
---|
51 |
|
---|
52 | /* PROVIDE(__cs3_heap_start = _end); */
|
---|
53 | /* PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram); */
|
---|
54 | /* PROVIDE(__cs3_region_num = (__cs3_regions_end - __cs3_regions) / 20); */
|
---|
55 | /* Ensure that newlib runs the finalizers */
|
---|
56 | __libc_fini = _fini;
|
---|
57 | /* PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram); */
|
---|
58 |
|
---|
59 | SECTIONS
|
---|
60 | {
|
---|
61 | .text :
|
---|
62 | {
|
---|
63 | CREATE_OBJECT_SYMBOLS
|
---|
64 | /* __cs3_region_start_ram = .; */
|
---|
65 | /* ASSERT (. == __cs3_region_start_ram, ".cs3.region-head.ram not permitted"); */
|
---|
66 | *(vector)
|
---|
67 | /* __cs3_reset = .; */
|
---|
68 | *(.text)
|
---|
69 | *(.text.*)
|
---|
70 | *(.gnu.linkonce.t.*)
|
---|
71 | *(.plt)
|
---|
72 | *(.gnu.warning)
|
---|
73 | *(.glue_7t) *(.glue_7)
|
---|
74 | *(.vfp11_veneer)
|
---|
75 |
|
---|
76 | *(.ARM.extab* .gnu.linkonce.armextab.*)
|
---|
77 | *(.gcc_except_table)
|
---|
78 | } >ram
|
---|
79 |
|
---|
80 | .eh_frame_hdr : ALIGN (4)
|
---|
81 | {
|
---|
82 | KEEP (*(.eh_frame_hdr))
|
---|
83 | } >ram
|
---|
84 |
|
---|
85 | .eh_frame : ALIGN (4)
|
---|
86 | {
|
---|
87 | KEEP (*(.eh_frame))
|
---|
88 | } >ram
|
---|
89 |
|
---|
90 | /* .ARM.exidx is sorted, so has to go in its own output section. */
|
---|
91 | __exidx_start = .;
|
---|
92 | .ARM.exidx :
|
---|
93 | {
|
---|
94 | *(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
---|
95 | } >ram
|
---|
96 | __exidx_end = .;
|
---|
97 |
|
---|
98 | .rodata : ALIGN (4)
|
---|
99 | {
|
---|
100 | *(.rodata .rodata.* .gnu.linkonce.r.*)
|
---|
101 |
|
---|
102 | . = ALIGN(4);
|
---|
103 | KEEP(*(.init))
|
---|
104 |
|
---|
105 | . = ALIGN(4);
|
---|
106 | __preinit_array_start = .;
|
---|
107 | KEEP (*(.preinit_array))
|
---|
108 | __preinit_array_end = .;
|
---|
109 |
|
---|
110 | . = ALIGN(4);
|
---|
111 | __init_array_start = .;
|
---|
112 | KEEP (*(SORT(.init_array.*)))
|
---|
113 | KEEP (*(.init_array))
|
---|
114 | __init_array_end = .;
|
---|
115 |
|
---|
116 | . = ALIGN(4);
|
---|
117 | KEEP(*(.fini))
|
---|
118 |
|
---|
119 | . = ALIGN(4);
|
---|
120 | __fini_array_start = .;
|
---|
121 | KEEP (*(.fini_array))
|
---|
122 | KEEP (*(SORT(.fini_array.*)))
|
---|
123 | __fini_array_end = .;
|
---|
124 |
|
---|
125 | . = ALIGN(0x4);
|
---|
126 | KEEP (*crtbegin.o(.ctors))
|
---|
127 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
|
---|
128 | KEEP (*(SORT(.ctors.*)))
|
---|
129 | KEEP (*crtend.o(.ctors))
|
---|
130 |
|
---|
131 | . = ALIGN(0x4);
|
---|
132 | KEEP (*crtbegin.o(.dtors))
|
---|
133 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
|
---|
134 | KEEP (*(SORT(.dtors.*)))
|
---|
135 | KEEP (*crtend.o(.dtors))
|
---|
136 |
|
---|
137 | . = ALIGN(4);
|
---|
138 | /* __cs3_regions = .; */
|
---|
139 | /* LONG (0) */
|
---|
140 | /* LONG (__cs3_region_init_ram) */
|
---|
141 | /* LONG (__cs3_region_start_ram) */
|
---|
142 | /* LONG (__cs3_region_init_size_ram) */
|
---|
143 | /* LONG (__cs3_region_zero_size_ram) */
|
---|
144 | /* __cs3_regions_end = .; */
|
---|
145 |
|
---|
146 | . = ALIGN (8);
|
---|
147 | _etext = .;
|
---|
148 | } >ram
|
---|
149 |
|
---|
150 | .data : ALIGN (8)
|
---|
151 | {
|
---|
152 | KEEP(*(.jcr))
|
---|
153 | *(.got.plt) *(.got)
|
---|
154 | *(.shdata)
|
---|
155 | *(.data .data.* .gnu.linkonce.d.*)
|
---|
156 | . = ALIGN (8);
|
---|
157 | *(.ram)
|
---|
158 | _edata = .;
|
---|
159 | } >ram
|
---|
160 |
|
---|
161 | .bss :
|
---|
162 | {
|
---|
163 | __bss_start__ = .;
|
---|
164 | *(.shbss)
|
---|
165 | *(.bss .bss.* .gnu.linkonce.b.*)
|
---|
166 | *(COMMON)
|
---|
167 | . = ALIGN (8);
|
---|
168 | *(.ram.b)
|
---|
169 | _end = .;
|
---|
170 | __end = .;
|
---|
171 | } >ram
|
---|
172 | __bss_end__ = .;
|
---|
173 |
|
---|
174 |
|
---|
175 | /* __cs3_region_end_ram is deprecated */
|
---|
176 | /* __cs3_region_end_ram = __cs3_region_start_ram + LENGTH(ram); */
|
---|
177 | /* __cs3_region_size_ram = LENGTH(ram); */
|
---|
178 | /* __cs3_region_init_ram = LOADADDR (.text); */
|
---|
179 | /* __cs3_region_init_size_ram = _edata - ADDR (.text); */
|
---|
180 | /* __cs3_region_zero_size_ram = _end - _edata; */
|
---|
181 |
|
---|
182 | .stab 0 (NOLOAD) : { *(.stab) }
|
---|
183 | .stabstr 0 (NOLOAD) : { *(.stabstr) }
|
---|
184 |
|
---|
185 | /* DWARF debug sections.
|
---|
186 | * Symbols in the DWARF debugging sections are relative to the beginning
|
---|
187 | * of the section so we begin them at 0. */
|
---|
188 |
|
---|
189 | /* DWARF 1 */
|
---|
190 | .debug 0 : { *(.debug) }
|
---|
191 | .line 0 : { *(.line) }
|
---|
192 |
|
---|
193 | /* GNU DWARF 1 extensions */
|
---|
194 | .debug_srcinfo 0 : { *(.debug_srcinfo) }
|
---|
195 | .debug_sfnames 0 : { *(.debug_sfnames) }
|
---|
196 |
|
---|
197 | /* DWARF 1.1 and DWARF 2 */
|
---|
198 | .debug_aranges 0 : { *(.debug_aranges) }
|
---|
199 | .debug_pubnames 0 : { *(.debug_pubnames) }
|
---|
200 |
|
---|
201 | /* DWARF 2 */
|
---|
202 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
---|
203 | .debug_abbrev 0 : { *(.debug_abbrev) }
|
---|
204 | .debug_line 0 : { *(.debug_line) }
|
---|
205 | .debug_frame 0 : { *(.debug_frame) }
|
---|
206 | .debug_str 0 : { *(.debug_str) }
|
---|
207 | .debug_loc 0 : { *(.debug_loc) }
|
---|
208 | .debug_macinfo 0 : { *(.debug_macinfo) }
|
---|
209 |
|
---|
210 | /* DWARF 2.1 */
|
---|
211 | .debug_ranges 0 : { *(.debug_ranges) }
|
---|
212 |
|
---|
213 | /* SGI/MIPS DWARF 2 extensions */
|
---|
214 | .debug_weaknames 0 : { *(.debug_weaknames) }
|
---|
215 | .debug_funcnames 0 : { *(.debug_funcnames) }
|
---|
216 | .debug_typenames 0 : { *(.debug_typenames) }
|
---|
217 | .debug_varnames 0 : { *(.debug_varnames) }
|
---|
218 |
|
---|
219 | .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
|
---|
220 | .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
|
---|
221 | /DISCARD/ : { *(.note.GNU-stack) }
|
---|
222 | }
|
---|