3 Copyright (c) 2005,2008,2009 Red Hat Incorporated.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
9 Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
12 Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
16 The name of Red Hat Incorporated may not be used to endorse
17 or promote products derived from this software without specific
18 prior written permission.
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
24 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 /* Default linker script, for normal executables */
37 /* Do we need any of these for elf?
40 /* This memory layout is larger than the largest predicted RX600 chip,
41 but gives us more memory for benchmarks. */
44 RAM (w) : ORIGIN = 0x01000000, LENGTH = 0x07000000 /* 112 Mb "external" address space. */
45 STACK (w) : ORIGIN = 0x08000000, LENGTH = 16 /* Top of RAM. */
53 *(.text P .stub .text.* .gnu.linkonce.t.*)
54 KEEP (*(.text.*personality*))
55 /* .gnu.warning sections are handled specially by elf32.em. */
57 *(.interp .hash .dynsym .dynstr .gnu.version*)
58 PROVIDE (__etext = .);
69 *(.rodata C C_2 C_1 .rodata.* .gnu.linkonce.r.*)
73 KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
75 PROVIDE(__romdatastart = .);
80 PROVIDE (__datastart = .);
81 PROVIDE (__preinit_array_start = .);
82 KEEP (*(.preinit_array))
83 PROVIDE (__preinit_array_end = .);
84 PROVIDE (__init_array_start = .);
85 KEEP (*(SORT(.init_array.*)))
87 PROVIDE (__init_array_end = .);
88 PROVIDE (__fini_array_start = .);
90 KEEP (*(SORT(.fini_array.*)))
91 PROVIDE (__fini_array_end = .);
92 LONG(0); /* Sentinel. */
94 /* gcc uses crtbegin.o to find the start of the constructors, so
95 we make sure it is first. Because this is a wildcard, it
96 doesn't matter if the user does not actually link against
97 crtbegin.o; the linker won't look for a file to match a
98 wildcard. The wildcard also means that it doesn't matter which
99 directory crtbegin.o is in. */
100 KEEP (*crtbegin*.o(.ctors))
102 /* We don't want to include the .ctor section from from the
103 crtend.o file until after the sorted ctors. The .ctor section
104 from the crtend file contains the end of ctors marker and it
106 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
107 KEEP (*(SORT(.ctors.*)))
110 KEEP (*crtbegin*.o(.dtors))
111 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
112 KEEP (*(SORT(.dtors.*)))
116 *(.data.rel.ro.local) *(.data.rel.ro*)
119 *(.data D .data.* .gnu.linkonce.d.*)
120 KEEP (*(.gnu.linkonce.d.*personality*))
125 /* We want the small data sections together, so single-instruction offsets
126 can access them all, and initialized data all before uninitialized, so
127 we can shorten the on-disk segment size. */
129 *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1)
134 PROVIDE (__dataend = .);
137 /* Note that crt0 assumes this is a multiple of four; all the
138 start/stop symbols are also assumed long-aligned. */
139 /* PROVIDE (__romdatacopysize = __dataend - __datastart); */
140 /* We're loading into simulator ram, no need to copy */
141 PROVIDE (__romdatacopysize = 0);
145 PROVIDE (__bssstart = .);
148 *(.bss B B_2 B_1 .bss.* .gnu.linkonce.b.*)
152 PROVIDE (__bssend = .);
156 PROVIDE (__bsssize = SIZEOF(.bss) / 4);
158 .stack (ORIGIN (STACK)) :
160 PROVIDE (__stack = .);
164 /* Providing one of these symbols in your code is sufficient to have
165 it linked in to the fixed vector table. */
167 PROVIDE (__rx_priviledged_exception_handler = 0x00000000);
168 PROVIDE (__rx_access_exception_handler = 0x00000000);
169 PROVIDE (__rx_undefined_exception_handler = 0x00000000);
170 PROVIDE (__rx_floating_exception_handler = 0x00000000);
171 PROVIDE (__rx_nonmaskable_exception_handler = 0x00000000);
173 .vectors (0xFFFFFFD0) :
175 PROVIDE (__vectors = .);
176 LONG (__rx_priviledged_exception_handler);
177 LONG (__rx_access_exception_handler);
179 LONG (__rx_undefined_exception_handler);
181 LONG (__rx_floating_exception_handler);
186 LONG (__rx_nonmaskable_exception_handler);
190 /* The rest are all not normally part of the runtime image. */
192 /* Stabs debugging sections. */
193 .stab 0 : { *(.stab) }
194 .stabstr 0 : { *(.stabstr) }
195 .stab.excl 0 : { *(.stab.excl) }
196 .stab.exclstr 0 : { *(.stab.exclstr) }
197 .stab.index 0 : { *(.stab.index) }
198 .stab.indexstr 0 : { *(.stab.indexstr) }
199 .comment 0 : { *(.comment) }
200 /* DWARF debug sections.
201 Symbols in the DWARF debugging sections are relative to the beginning
202 of the section so we begin them at 0. */
204 .debug 0 : { *(.debug) }
205 .line 0 : { *(.line) }
206 /* GNU DWARF 1 extensions */
207 .debug_srcinfo 0 : { *(.debug_srcinfo) }
208 .debug_sfnames 0 : { *(.debug_sfnames) }
209 /* DWARF 1.1 and DWARF 2 */
210 .debug_aranges 0 : { *(.debug_aranges) }
211 .debug_pubnames 0 : { *(.debug_pubnames) }
213 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
214 .debug_abbrev 0 : { *(.debug_abbrev) }
215 .debug_line 0 : { *(.debug_line) }
216 .debug_frame 0 : { *(.debug_frame) }
217 .debug_str 0 : { *(.debug_str) }
218 .debug_loc 0 : { *(.debug_loc) }
219 .debug_macinfo 0 : { *(.debug_macinfo) }
220 /* SGI/MIPS DWARF 2 extensions */
221 .debug_weaknames 0 : { *(.debug_weaknames) }
222 .debug_funcnames 0 : { *(.debug_funcnames) }
223 .debug_typenames 0 : { *(.debug_typenames) }
224 .debug_varnames 0 : { *(.debug_varnames) }
225 /DISCARD/ : { *(.note.GNU-stack) }