1 /***********************license start***************
2 * Copyright (c) 2003-2010 Cavium Inc. (support@cavium.com). All rights
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * * Neither the name of Cavium Inc. nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
46 * This was created from a template supplied by GNU binutils.
47 * Copyright (C) 2004 Cavium Inc.
52 * This linker script for use in building simple executive application to run
53 * under Linux in userspace. The important difference from a standard Linux
54 * binary is the addition of the ".cvmx_shared" memory section. This script
55 * adds two symbols __cvmx_shared_start and __cvmx_sahred_end before and after
56 * the CVMX_SHARED data. These are used by cvmx-app-init-linux.c to create a
57 * shared region across all application processes.
59 * The original template for this files was:
60 * ${OCTEON_ROOT}/tools/mips64-octeon-linux-gnu/lib/ldscripts/elf32btsmip.x
62 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
63 "elf32-tradlittlemips")
66 SEARCH_DIR("${OCTEON_ROOT}/tools/mips64-octeon-linux-gnu/lib");
67 /* Do we need any of these for elf?
71 /* Read-only sections, merged into text segment: */
72 PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS;
73 .interp : { *(.interp) }
74 .reginfo : { *(.reginfo) }
75 .dynamic : { *(.dynamic) }
77 .dynsym : { *(.dynsym) }
78 .dynstr : { *(.dynstr) }
79 .gnu.version : { *(.gnu.version) }
80 .gnu.version_d : { *(.gnu.version_d) }
81 .gnu.version_r : { *(.gnu.version_r) }
82 .rel.init : { *(.rel.init) }
83 .rela.init : { *(.rela.init) }
84 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
85 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
86 .rel.fini : { *(.rel.fini) }
87 .rela.fini : { *(.rela.fini) }
88 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
89 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
90 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
91 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
92 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
93 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
94 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
95 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
96 .rel.ctors : { *(.rel.ctors) }
97 .rela.ctors : { *(.rela.ctors) }
98 .rel.dtors : { *(.rel.dtors) }
99 .rela.dtors : { *(.rela.dtors) }
100 .rel.got : { *(.rel.got) }
101 .rela.got : { *(.rela.got) }
102 .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
103 .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
104 .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
105 .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
106 .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
107 .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
108 .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
109 .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
110 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
111 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
112 .rel.plt : { *(.rel.plt) }
113 .rela.plt : { *(.rela.plt) }
122 *(.text .stub .text.* .gnu.linkonce.t.*)
123 /* .gnu.warning sections are handled specially by elf32.em. */
125 *(.mips16.fn.*) *(.mips16.call.*)
131 PROVIDE (__etext = .);
132 PROVIDE (_etext = .);
134 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
135 .rodata1 : { *(.rodata1) }
136 .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
137 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
138 .eh_frame_hdr : { *(.eh_frame_hdr) }
139 /* Adjust the address for the data segment. We want to adjust up to
140 the same address within the page on the next page up. */
142 /* Ensure the __preinit_array_start label is properly aligned. We
143 could instead move the label definition inside the section, but
144 the linker would then create the section even if it turns out to
145 be empty, which isn't pretty. */
147 PROVIDE (__preinit_array_start = .);
148 .preinit_array : { *(.preinit_array) }
149 PROVIDE (__preinit_array_end = .);
150 PROVIDE (__init_array_start = .);
151 .init_array : { *(.init_array) }
152 PROVIDE (__init_array_end = .);
153 PROVIDE (__fini_array_start = .);
154 .fini_array : { *(.fini_array) }
155 PROVIDE (__fini_array_end = .);
159 *(.data .data.* .gnu.linkonce.d.*)
162 .data1 : { *(.data1) }
163 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
164 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
165 .eh_frame : { KEEP (*(.eh_frame)) }
166 .gcc_except_table : { *(.gcc_except_table) }
169 /* gcc uses crtbegin.o to find the start of
170 the constructors, so we make sure it is
171 first. Because this is a wildcard, it
172 doesn't matter if the user does not
173 actually link against crtbegin.o; the
174 linker won't look for a file to match a
175 wildcard. The wildcard also means that it
176 doesn't matter which directory crtbegin.o
178 KEEP (*crtbegin*.o(.ctors))
179 /* We don't want to include the .ctor section from
180 from the crtend.o file until after the sorted ctors.
181 The .ctor section from the crtend file contains the
182 end of ctors marker and it must be last */
183 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
184 KEEP (*(SORT(.ctors.*)))
189 KEEP (*crtbegin*.o(.dtors))
190 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
191 KEEP (*(SORT(.dtors.*)))
194 .jcr : { KEEP (*(.jcr)) }
195 _gp = ALIGN(16) + 0x7ff0;
196 .got : { *(.got.plt) *(.got) }
197 /* We want the small data sections together, so single-instruction offsets
198 can access them all, and initialized data all before uninitialized, so
199 we can shorten the on-disk segment size. */
202 *(.sdata .sdata.* .gnu.linkonce.s.*)
208 __cvmx_shared_start = .;
209 .cvmx_shared : {*(.cvmx_shared .cvmx_shared.linkonce.*)}
210 .cvmx_shared_bss : {*(.cvmx_shared_bss .cvmx_shared_bss.linkonce.*)}
212 __cvmx_shared_end = .;
220 PROVIDE (__sbss_start = .);
221 PROVIDE (___sbss_start = .);
223 *(.sbss .sbss.* .gnu.linkonce.sb.*)
225 PROVIDE (__sbss_end = .);
226 PROVIDE (___sbss_end = .);
231 *(.bss .bss.* .gnu.linkonce.b.*)
233 /* Align here to ensure that the .bss section occupies space up to
234 _end. Align after .bss to ensure correct alignment even if the
235 .bss section disappears because there are no input sections. */
239 . = ALIGN(32M); /* RBF added alignment of data */
240 .cvmx_shared : { *(.cvmx_shared) }
243 /* Stabs debugging sections. */
244 .stab 0 : { *(.stab) }
245 .stabstr 0 : { *(.stabstr) }
246 .stab.excl 0 : { *(.stab.excl) }
247 .stab.exclstr 0 : { *(.stab.exclstr) }
248 .stab.index 0 : { *(.stab.index) }
249 .stab.indexstr 0 : { *(.stab.indexstr) }
250 .comment 0 : { *(.comment) }
251 /* DWARF debug sections.
252 Symbols in the DWARF debugging sections are relative to the beginning
253 of the section so we begin them at 0. */
255 .debug 0 : { *(.debug) }
256 .line 0 : { *(.line) }
257 /* GNU DWARF 1 extensions */
258 .debug_srcinfo 0 : { *(.debug_srcinfo) }
259 .debug_sfnames 0 : { *(.debug_sfnames) }
260 /* DWARF 1.1 and DWARF 2 */
261 .debug_aranges 0 : { *(.debug_aranges) }
262 .debug_pubnames 0 : { *(.debug_pubnames) }
264 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
265 .debug_abbrev 0 : { *(.debug_abbrev) }
266 .debug_line 0 : { *(.debug_line) }
267 .debug_frame 0 : { *(.debug_frame) }
268 .debug_str 0 : { *(.debug_str) }
269 .debug_loc 0 : { *(.debug_loc) }
270 .debug_macinfo 0 : { *(.debug_macinfo) }
271 /* SGI/MIPS DWARF 2 extensions */
272 .debug_weaknames 0 : { *(.debug_weaknames) }
273 .debug_funcnames 0 : { *(.debug_funcnames) }
274 .debug_typenames 0 : { *(.debug_typenames) }
275 .debug_varnames 0 : { *(.debug_varnames) }
276 .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
277 .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
278 /DISCARD/ : { *(.note.GNU-stack) }