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 corresponds to the smallest predicted RX600 chip. */
42 RAM (w) : ORIGIN = 0x00000000, LENGTH = 0x00020000 /* 128k */
43 STACK (w) : ORIGIN = 0x00020000, LENGTH = 16 /* top of RAM */
45 ROM (w) : ORIGIN = 0xfff40000, LENGTH = 0x000bffd0 /* 768k */
46 /* This is the largest RX6000: */
47 /* ROM (w) : ORIGIN = 0xffe00000, LENGTH = 0x001fffd0 */ /* 2Mb */
55 *(.text P .stub .text.* .gnu.linkonce.t.*)
56 KEEP (*(.text.*personality*))
57 /* .gnu.warning sections are handled specially by elf32.em. */
59 *(.interp .hash .dynsym .dynstr .gnu.version*)
60 PROVIDE (__etext = .);
71 *(.rodata C C_2 C_1 W W_2 W_1 .rodata.* .gnu.linkonce.r.*)
75 KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
77 PROVIDE(__romdatastart = .);
82 PROVIDE (__datastart = .); /* IF_ROROM */
83 PROVIDE (__preinit_array_start = .);
84 KEEP (*(.preinit_array))
85 PROVIDE (__preinit_array_end = .);
86 PROVIDE (__init_array_start = .);
87 KEEP (*(SORT(.init_array.*)))
89 PROVIDE (__init_array_end = .);
90 PROVIDE (__fini_array_start = .);
92 KEEP (*(SORT(.fini_array.*)))
93 PROVIDE (__fini_array_end = .);
94 LONG(0); /* Sentinel. */
96 /* gcc uses crtbegin.o to find the start of the constructors, so
97 we make sure it is first. Because this is a wildcard, it
98 doesn't matter if the user does not actually link against
99 crtbegin.o; the linker won't look for a file to match a
100 wildcard. The wildcard also means that it doesn't matter which
101 directory crtbegin.o is in. */
102 KEEP (*crtbegin*.o(.ctors))
104 /* We don't want to include the .ctor section from from the
105 crtend.o file until after the sorted ctors. The .ctor section
106 from the crtend file contains the end of ctors marker and it
108 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
109 KEEP (*(SORT(.ctors.*)))
112 KEEP (*crtbegin*.o(.dtors))
113 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
114 KEEP (*(SORT(.dtors.*)))
118 *(.data.rel.ro.local) *(.data.rel.ro*)
121 *(.data D .data.* .gnu.linkonce.d.*)
122 KEEP (*(.gnu.linkonce.d.*personality*))
127 /* We want the small data sections together, so single-instruction offsets
128 can access them all, and initialized data all before uninitialized, so
129 we can shorten the on-disk segment size. */
131 *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1)
136 PROVIDE (__dataend = .);
139 /* Note that __romdatacopysize may be ZERO for the simulator, which
140 knows how to intialize RAM directly. It should ONLY be used for
141 copying data from ROM to RAM; if you need to know the size of the
142 data section, subtract the end symbol from the start symbol. */
143 /* Note that crt0 assumes this is a multiple of four; all the
144 start/stop symbols are also assumed long-aligned. */
145 PROVIDE (__romdatacopysize = SIZEOF(.data));
149 PROVIDE (__bssstart = .);
152 *(.bss B B_2 B_1 .bss.* .gnu.linkonce.b.*)
156 PROVIDE (__bssend = .);
160 PROVIDE (__bsssize = SIZEOF(.bss) / 4);
162 .stack (ORIGIN (STACK)) :
164 PROVIDE (__stack = .);
168 /* Providing one of these symbols in your code is sufficient to have
169 it linked in to the fixed vector table. */
171 PROVIDE (__rx_priviledged_exception_handler = 0x00000000);
172 PROVIDE (__rx_access_exception_handler = 0x00000000);
173 PROVIDE (__rx_undefined_exception_handler = 0x00000000);
174 PROVIDE (__rx_floating_exception_handler = 0x00000000);
175 PROVIDE (__rx_nonmaskable_exception_handler = 0x00000000);
177 .vectors (0xFFFFFFD0) :
179 PROVIDE (__vectors = .);
180 LONG (__rx_priviledged_exception_handler);
181 LONG (__rx_access_exception_handler);
183 LONG (__rx_undefined_exception_handler);
185 LONG (__rx_floating_exception_handler);
190 LONG (__rx_nonmaskable_exception_handler);
194 /* The rest are all not normally part of the runtime image. */
196 /* Stabs debugging sections. */
197 .stab 0 : { *(.stab) }
198 .stabstr 0 : { *(.stabstr) }
199 .stab.excl 0 : { *(.stab.excl) }
200 .stab.exclstr 0 : { *(.stab.exclstr) }
201 .stab.index 0 : { *(.stab.index) }
202 .stab.indexstr 0 : { *(.stab.indexstr) }
203 .comment 0 : { *(.comment) }
204 /* DWARF debug sections.
205 Symbols in the DWARF debugging sections are relative to the beginning
206 of the section so we begin them at 0. */
208 .debug 0 : { *(.debug) }
209 .line 0 : { *(.line) }
210 /* GNU DWARF 1 extensions */
211 .debug_srcinfo 0 : { *(.debug_srcinfo) }
212 .debug_sfnames 0 : { *(.debug_sfnames) }
213 /* DWARF 1.1 and DWARF 2 */
214 .debug_aranges 0 : { *(.debug_aranges) }
215 .debug_pubnames 0 : { *(.debug_pubnames) }
217 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
218 .debug_abbrev 0 : { *(.debug_abbrev) }
219 .debug_line 0 : { *(.debug_line) }
220 .debug_frame 0 : { *(.debug_frame) }
221 .debug_str 0 : { *(.debug_str) }
222 .debug_loc 0 : { *(.debug_loc) }
223 .debug_macinfo 0 : { *(.debug_macinfo) }
224 /* SGI/MIPS DWARF 2 extensions */
225 .debug_weaknames 0 : { *(.debug_weaknames) }
226 .debug_funcnames 0 : { *(.debug_funcnames) }
227 .debug_typenames 0 : { *(.debug_typenames) }
228 .debug_varnames 0 : { *(.debug_varnames) }
229 /DISCARD/ : { *(.note.GNU-stack) }