]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - sys/contrib/octeon-sdk/cvmx-shared-linux-o32.ld
Merge MIPS platform support to 8-STABLE.
[FreeBSD/stable/8.git] / sys / contrib / octeon-sdk / cvmx-shared-linux-o32.ld
1 /***********************license start***************
2  * Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights
3  * reserved.
4  *
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  *     * Redistributions of source code must retain the above copyright
11  *       notice, this list of conditions and the following disclaimer.
12  *
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.
17  *
18  *     * Neither the name of Cavium Networks nor the names of
19  *       its contributors may be used to endorse or promote products
20  *       derived from this software without specific prior written
21  *       permission.
22  *
23  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
24  * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS
25  * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
26  * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
27  * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
28  * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES
29  * OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR
30  * PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET
31  * POSSESSION OR CORRESPONDENCE TO DESCRIPTION.  THE ENTIRE RISK ARISING OUT
32  * OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
33  *
34  *
35  * For any questions regarding licensing please contact marketing@caviumnetworks.com
36  *
37  ***********************license end**************************************/
38
39
40
41
42
43 /*
44  * This was created from a template supplied by GNU binutils.
45  * Copyright (C) 2004 Cavium Networks
46  */
47
48 /**
49  * @file
50  * This linker script for use in building simple executive application to run
51  * under Linux in userspace. The important difference from a standard Linux
52  * binary is the addition of the ".cvmx_shared" memory section. This script
53  * adds two symbols __cvmx_shared_start and __cvmx_sahred_end before and after
54  * the CVMX_SHARED data. These are used by cvmx-app-init-linux.c to create a
55  * shared region across all application processes.
56  *
57  * The original template for this files was:
58  * ${OCTEON_ROOT}/tools/mips64-octeon-linux-gnu/lib/ldscripts/elf32btsmip.x
59  */
60 OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips",
61               "elf32-tradlittlemips")
62 OUTPUT_ARCH(mips)
63 ENTRY(__start)
64 SEARCH_DIR("${OCTEON_ROOT}/tools/mips64-octeon-linux-gnu/lib");
65 /* Do we need any of these for elf?
66    __DYNAMIC = 0;    */
67 SECTIONS
68 {
69   /* Read-only sections, merged into text segment: */
70   PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS;
71   .interp         : { *(.interp) }
72   .reginfo        : { *(.reginfo) }
73   .dynamic        : { *(.dynamic) }
74   .hash           : { *(.hash) }
75   .dynsym         : { *(.dynsym) }
76   .dynstr         : { *(.dynstr) }
77   .gnu.version    : { *(.gnu.version) }
78   .gnu.version_d  : { *(.gnu.version_d) }
79   .gnu.version_r  : { *(.gnu.version_r) }
80   .rel.init       : { *(.rel.init) }
81   .rela.init      : { *(.rela.init) }
82   .rel.text       : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
83   .rela.text      : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
84   .rel.fini       : { *(.rel.fini) }
85   .rela.fini      : { *(.rela.fini) }
86   .rel.rodata     : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
87   .rela.rodata    : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
88   .rel.data       : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
89   .rela.data      : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
90   .rel.tdata      : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
91   .rela.tdata     : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
92   .rel.tbss       : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
93   .rela.tbss      : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
94   .rel.ctors      : { *(.rel.ctors) }
95   .rela.ctors     : { *(.rela.ctors) }
96   .rel.dtors      : { *(.rel.dtors) }
97   .rela.dtors     : { *(.rela.dtors) }
98   .rel.got        : { *(.rel.got) }
99   .rela.got       : { *(.rela.got) }
100   .rel.sdata      : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
101   .rela.sdata     : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
102   .rel.sbss       : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
103   .rela.sbss      : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
104   .rel.sdata2     : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
105   .rela.sdata2    : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
106   .rel.sbss2      : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
107   .rela.sbss2     : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
108   .rel.bss        : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
109   .rela.bss       : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
110   .rel.plt        : { *(.rel.plt) }
111   .rela.plt       : { *(.rela.plt) }
112   .init           :
113   {
114     KEEP (*(.init))
115   } =0
116   .plt            : { *(.plt) }
117   .text           :
118   {
119     _ftext = . ;
120     *(.text .stub .text.* .gnu.linkonce.t.*)
121     /* .gnu.warning sections are handled specially by elf32.em.  */
122     *(.gnu.warning)
123     *(.mips16.fn.*) *(.mips16.call.*)
124   } =0
125   .fini           :
126   {
127     KEEP (*(.fini))
128   } =0
129   PROVIDE (__etext = .);
130   PROVIDE (_etext = .);
131   PROVIDE (etext = .);
132   .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
133   .rodata1        : { *(.rodata1) }
134   .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
135   .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
136   .eh_frame_hdr : { *(.eh_frame_hdr) }
137   /* Adjust the address for the data segment.  We want to adjust up to
138      the same address within the page on the next page up.  */
139   . = 0x10000000;
140   /* Ensure the __preinit_array_start label is properly aligned.  We
141      could instead move the label definition inside the section, but
142      the linker would then create the section even if it turns out to
143      be empty, which isn't pretty.  */
144   . = ALIGN(32 / 8);
145   PROVIDE (__preinit_array_start = .);
146   .preinit_array     : { *(.preinit_array) }
147   PROVIDE (__preinit_array_end = .);
148   PROVIDE (__init_array_start = .);
149   .init_array     : { *(.init_array) }
150   PROVIDE (__init_array_end = .);
151   PROVIDE (__fini_array_start = .);
152   .fini_array     : { *(.fini_array) }
153   PROVIDE (__fini_array_end = .);
154   .data           :
155   {
156     _fdata = . ;
157     *(.data .data.* .gnu.linkonce.d.*)
158     SORT(CONSTRUCTORS)
159   }
160   .data1          : { *(.data1) }
161   .tdata          : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
162   .tbss           : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
163   .eh_frame       : { KEEP (*(.eh_frame)) }
164   .gcc_except_table   : { *(.gcc_except_table) }
165   .ctors          :
166   {
167     /* gcc uses crtbegin.o to find the start of
168        the constructors, so we make sure it is
169        first.  Because this is a wildcard, it
170        doesn't matter if the user does not
171        actually link against crtbegin.o; the
172        linker won't look for a file to match a
173        wildcard.  The wildcard also means that it
174        doesn't matter which directory crtbegin.o
175        is in.  */
176     KEEP (*crtbegin*.o(.ctors))
177     /* We don't want to include the .ctor section from
178        from the crtend.o file until after the sorted ctors.
179        The .ctor section from the crtend file contains the
180        end of ctors marker and it must be last */
181     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
182     KEEP (*(SORT(.ctors.*)))
183     KEEP (*(.ctors))
184   }
185   .dtors          :
186   {
187     KEEP (*crtbegin*.o(.dtors))
188     KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
189     KEEP (*(SORT(.dtors.*)))
190     KEEP (*(.dtors))
191   }
192   .jcr            : { KEEP (*(.jcr)) }
193   _gp = ALIGN(16) + 0x7ff0;
194   .got            : { *(.got.plt) *(.got) }
195   /* We want the small data sections together, so single-instruction offsets
196      can access them all, and initialized data all before uninitialized, so
197      we can shorten the on-disk segment size.  */
198   .sdata          :
199   {
200     *(.sdata .sdata.* .gnu.linkonce.s.*)
201   }
202   .lit8           : { *(.lit8) }
203   .lit4           : { *(.lit4) }
204
205   . = ALIGN (0x10000);
206   __cvmx_shared_start = .;
207   .cvmx_shared : {*(.cvmx_shared .cvmx_shared.linkonce.*)}
208   .cvmx_shared_bss : {*(.cvmx_shared_bss .cvmx_shared_bss.linkonce.*)}
209   . = ALIGN (0x10000);
210   __cvmx_shared_end = .;
211
212   _edata = .;
213   PROVIDE (edata = .);
214   __bss_start = .;
215   _fbss = .;
216   .sbss           :
217   {
218     PROVIDE (__sbss_start = .);
219     PROVIDE (___sbss_start = .);
220     *(.dynsbss)
221     *(.sbss .sbss.* .gnu.linkonce.sb.*)
222     *(.scommon)
223     PROVIDE (__sbss_end = .);
224     PROVIDE (___sbss_end = .);
225   }
226   .bss            :
227   {
228    *(.dynbss)
229    *(.bss .bss.* .gnu.linkonce.b.*)
230    *(COMMON)
231    /* Align here to ensure that the .bss section occupies space up to
232       _end.  Align after .bss to ensure correct alignment even if the
233       .bss section disappears because there are no input sections.  */
234    . = ALIGN(32 / 8);
235   }
236   . = ALIGN(32 / 8);
237   . = ALIGN(32M);    /* RBF added alignment of data */
238   .cvmx_shared : { *(.cvmx_shared) }
239   _end = .;
240   PROVIDE (end = .);
241   /* Stabs debugging sections.  */
242   .stab          0 : { *(.stab) }
243   .stabstr       0 : { *(.stabstr) }
244   .stab.excl     0 : { *(.stab.excl) }
245   .stab.exclstr  0 : { *(.stab.exclstr) }
246   .stab.index    0 : { *(.stab.index) }
247   .stab.indexstr 0 : { *(.stab.indexstr) }
248   .comment       0 : { *(.comment) }
249   /* DWARF debug sections.
250      Symbols in the DWARF debugging sections are relative to the beginning
251      of the section so we begin them at 0.  */
252   /* DWARF 1 */
253   .debug          0 : { *(.debug) }
254   .line           0 : { *(.line) }
255   /* GNU DWARF 1 extensions */
256   .debug_srcinfo  0 : { *(.debug_srcinfo) }
257   .debug_sfnames  0 : { *(.debug_sfnames) }
258   /* DWARF 1.1 and DWARF 2 */
259   .debug_aranges  0 : { *(.debug_aranges) }
260   .debug_pubnames 0 : { *(.debug_pubnames) }
261   /* DWARF 2 */
262   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
263   .debug_abbrev   0 : { *(.debug_abbrev) }
264   .debug_line     0 : { *(.debug_line) }
265   .debug_frame    0 : { *(.debug_frame) }
266   .debug_str      0 : { *(.debug_str) }
267   .debug_loc      0 : { *(.debug_loc) }
268   .debug_macinfo  0 : { *(.debug_macinfo) }
269   /* SGI/MIPS DWARF 2 extensions */
270   .debug_weaknames 0 : { *(.debug_weaknames) }
271   .debug_funcnames 0 : { *(.debug_funcnames) }
272   .debug_typenames 0 : { *(.debug_typenames) }
273   .debug_varnames  0 : { *(.debug_varnames) }
274   .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
275   .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
276   /DISCARD/ : { *(.note.GNU-stack) }
277 }