Back to home page

LXR

 
 

    


Warning, /bsps/m68k/mcf5225x/start/linkcmds is written in an unsupported language. File is not indexed.

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /*
0004  *  This file contains directives for the GNU linker which are specific
0005  *  to the Freescale ColdFire mcf52258
0006  *
0007  *  COPYRIGHT (c) 1989-1999.
0008  *  On-Line Applications Research Corporation (OAR).
0009  *
0010  * Redistribution and use in source and binary forms, with or without
0011  * modification, are permitted provided that the following conditions
0012  * are met:
0013  * 1. Redistributions of source code must retain the above copyright
0014  *    notice, this list of conditions and the following disclaimer.
0015  * 2. Redistributions in binary form must reproduce the above copyright
0016  *    notice, this list of conditions and the following disclaimer in the
0017  *    documentation and/or other materials provided with the distribution.
0018  *
0019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0020  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0022  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0023  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0024  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0025  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0026  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0027  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0028  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0029  * POSSIBILITY OF SUCH DAMAGE.e
0030  */
0031 
0032 /*
0033  * Declare some sizes.
0034  */
0035 RamBase = DEFINED(RamBase) ? RamBase : 0x20000000;
0036 RamSize = DEFINED(RamSize) ? RamSize : 64K;
0037 RamEnd = RamBase + RamSize;
0038 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
0039 _FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000;
0040 
0041 _VBR = 0x20000000;
0042 
0043 ENTRY(start)
0044 STARTUP(start.o)
0045 
0046 
0047 MEMORY
0048 {
0049     sram : ORIGIN = 0x20000000, LENGTH = 64K
0050     flash : ORIGIN = 0x00000000, LENGTH = 512K
0051 }
0052 
0053 SECTIONS
0054 {
0055     /*
0056     * Text, data and bss segments
0057     */
0058     .text : {
0059 
0060         *(.text*)
0061         *(.ram_code)
0062 
0063         /*
0064         * C++ constructors/destructors
0065         */
0066         *(.gnu.linkonce.t.*)
0067 
0068         /*
0069         * Initialization and finalization code.
0070         *
0071         * Various files can provide initialization and finalization
0072         * functions.  crtbegin.o and crtend.o are two instances. The
0073         * body of these functions are in .init and .fini sections. We
0074         * accumulate the bodies here, and prepend function prologues
0075         * from crti.o and function epilogues from crtn.o. crti.o must
0076         * be linked first; crtn.o must be linked last.  Because these
0077         * are wildcards, it doesn't matter if the user does not
0078         * actually link against crti.o and crtn.o; the linker won't
0079         * look for a file to match a wildcard.  The wildcard also
0080         * means that it doesn't matter which directory crti.o and
0081         * crtn.o are in. 
0082         */
0083         PROVIDE (_init = .);
0084         *crti.o(.init)
0085         *(.init)
0086         *crtn.o(.init)
0087         PROVIDE (_fini = .);
0088         *crti.o(.fini)
0089         *(.fini)
0090         *crtn.o(.fini)
0091 
0092         /*
0093             * Special FreeBSD sysctl sections.
0094             */
0095         . = ALIGN (16);
0096         __start_set_sysctl_set = .;
0097         *(set_sysctl_*);
0098         __stop_set_sysctl_set = ABSOLUTE(.);
0099         *(set_domain_*);
0100         *(set_pseudo_*);
0101 
0102         /*
0103         * C++ constructors/destructors
0104         *
0105         * gcc uses crtbegin.o to find the start of the constructors
0106         * and destructors so we make sure it is first.  Because this
0107         * is a wildcard, it doesn't matter if the user does not
0108         * actually link against crtbegin.o; the linker won't look for
0109         * a file to match a wildcard.  The wildcard also means that
0110         * it doesn't matter which directory crtbegin.o is in. The
0111         * constructor and destructor list are terminated in
0112         * crtend.o.  The same comments apply to it.
0113         */
0114         . = ALIGN (16);
0115         *crtbegin.o(.ctors)
0116         *(.ctors)
0117         *crtend.o(.ctors)
0118         *crtbegin.o(.dtors)
0119         *(.dtors)
0120         *crtend.o(.dtors)
0121 
0122         /*
0123         * Exception frame info
0124         */
0125         . = ALIGN (16);
0126         *(.eh_frame)
0127 
0128         /*
0129         * Read-only data
0130         */
0131         . = ALIGN (16);
0132         _rodata_start = . ;
0133         *(.rodata*)
0134         KEEP (*(SORT(.rtemsroset.*)))
0135         *(.gnu.linkonce.r*)
0136 
0137         . = ALIGN (16);
0138 
0139         *(.console_gdb_xfer)
0140         *(.bootstrap_data)
0141     } >flash
0142 
0143     .tdata : {
0144         _TLS_Data_begin = .;
0145         *(.tdata .tdata.* .gnu.linkonce.td.*)
0146         _TLS_Data_end = .;
0147         . = ALIGN(16);
0148         _estuff = .;
0149         PROVIDE (_etext = .);
0150     } >flash
0151 
0152     .tbss : {
0153         _TLS_BSS_begin = .;
0154         *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0155         _TLS_BSS_end = .;
0156     } >flash
0157 
0158     _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0159     _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0160     _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0161     _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0162     _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0163     _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0164 
0165     .data 0x20000400 : AT (_estuff)
0166     {
0167         PROVIDE( _data_dest_start = . );
0168         PROVIDE( _copy_start = .);
0169         *(.data*)
0170         KEEP (*(SORT(.rtemsrwset.*)))
0171         *(.gnu.linkonce.d*)
0172         *(.gcc_except_table*)
0173         *(.jcr)
0174         . = ALIGN (16);
0175         PROVIDE (_edata = .);
0176         PROVIDE (_copy_end = .);
0177         PROVIDE (_data_dest_end = . );
0178     } >sram
0179 
0180     _data_src_start = _estuff;
0181     _data_src_end = _data_dest_start + SIZEOF(.data);
0182 
0183     .bss : 
0184     {
0185         PROVIDE (_clear_start = .);
0186         *(.bss*)
0187         *(COMMON)
0188         . = ALIGN (16);
0189         PROVIDE (_end = .);
0190         PROVIDE (_clear_end = .);
0191     } >sram
0192 
0193     .noinit (NOLOAD) : {
0194         *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0195     } >sram
0196 
0197     .rtemsstack (NOLOAD) : {
0198         *(SORT(.rtemsstack.*))
0199         PROVIDE(WorkAreaBase = .);
0200     } >sram
0201 
0202     /* Stabs debugging sections.  */
0203     .stab 0 : { *(.stab) }
0204     .stabstr 0 : { *(.stabstr) }
0205     .stab.excl 0 : { *(.stab.excl) }
0206     .stab.exclstr 0 : { *(.stab.exclstr) }
0207     .stab.index 0 : { *(.stab.index) }
0208     .stab.indexstr 0 : { *(.stab.indexstr) }
0209     .comment 0 : { *(.comment) }
0210 
0211     /* Addition to let linker know about custom section for GDB pretty-printing support. */
0212     .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0213     
0214     PROVIDE (end_of_all = .);
0215 }