Back to home page

LXR

 
 

    


Warning, /bsps/m68k/mcf5235/start/linkcmdsram 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 mcf5235
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.
0030  */
0031 
0032 /*
0033  * declare for the MCF5235_BSP_START_FROM_FLASH
0034  * 0 - use debug monitor to load to ram
0035  * 1 - load everything from flash from scratch
0036  */
0037 MCF5235_BSP_START_FROM_FLASH = 0;
0038 
0039 /*
0040  * Declare some sizes.
0041  */
0042 RamBase = DEFINED(RamBase) ? RamBase : 0x0;
0043 RamSize = DEFINED(RamSize) ? RamSize : 16M;
0044 RamEnd = RamBase + RamSize;
0045 HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
0046 
0047 
0048 /*
0049  * System clock speed
0050  */
0051 _CPUClockSpeed = DEFINED(_CPUClockSpeed) ? _CPUClockSpeed : 150000000 ;
0052 
0053 /*
0054  * Location of on-chip devices
0055  */
0056 __IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
0057 __SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
0058 _VBR = 0x0;
0059 
0060 ENTRY(start)
0061 STARTUP(start.o)
0062 
0063 MEMORY
0064 {
0065     ram : ORIGIN = 0, LENGTH = 16M
0066     sram : ORIGIN = 0x20000000, LENGTH = 64K
0067     flash : ORIGIN = 0xFFE00000, LENGTH = 2M
0068 }
0069 
0070 SECTIONS
0071 {
0072     
0073     _header_offset = 0;
0074     
0075     /*
0076      * Text, data and bss segments
0077      */
0078     .text 0x40000 : {
0079        
0080        *(.text*)
0081         *(.ram_code)
0082 
0083         /*
0084          * C++ constructors/destructors
0085          */
0086         *(.gnu.linkonce.t.*)
0087 
0088         /*
0089          * Initialization and finalization code.
0090               *
0091               * Various files can provide initialization and finalization
0092          * functions.  crtbegin.o and crtend.o are two instances. The
0093          * body of these functions are in .init and .fini sections. We
0094          * accumulate the bodies here, and prepend function prologues
0095          * from crti.o and function epilogues from crtn.o. crti.o must
0096          * be linked first; crtn.o must be linked last.  Because these
0097          * are wildcards, it doesn't matter if the user does not
0098          * actually link against crti.o and crtn.o; the linker won't
0099          * look for a file to match a wildcard.  The wildcard also
0100          * means that it doesn't matter which directory crti.o and
0101          * crtn.o are in. 
0102          */
0103         PROVIDE (_init = .);
0104         *crti.o(.init)
0105         *(.init)
0106         *crtn.o(.init)
0107         PROVIDE (_fini = .);
0108         *crti.o(.fini)
0109         *(.fini)
0110         *crtn.o(.fini)
0111 
0112         /*
0113          * Special FreeBSD sysctl sections.
0114          */
0115         . = ALIGN (16);
0116         __start_set_sysctl_set = .;
0117         *(set_sysctl_*);
0118         __stop_set_sysctl_set = ABSOLUTE(.);
0119         *(set_domain_*);
0120         *(set_pseudo_*);
0121 
0122 
0123         /*
0124          * C++ constructors/destructors
0125          *
0126          * gcc uses crtbegin.o to find the start of the constructors
0127          * and destructors so we make sure it is first.  Because this
0128          * is a wildcard, it doesn't matter if the user does not
0129          * actually link against crtbegin.o; the linker won't look for
0130          * a file to match a wildcard.  The wildcard also means that
0131          * it doesn't matter which directory crtbegin.o is in. The
0132          * constructor and destructor list are terminated in
0133          * crtend.o.  The same comments apply to it.
0134          */
0135         . = ALIGN (16);
0136         *crtbegin.o(.ctors)
0137         *(.ctors)
0138         *crtend.o(.ctors)
0139         *crtbegin.o(.dtors)
0140         *(.dtors)
0141         *crtend.o(.dtors)
0142 
0143         /*
0144          * Exception frame info
0145          */
0146         . = ALIGN (16);
0147         *(.eh_frame)
0148 
0149         /*
0150          * Read-only data
0151          */
0152         . = ALIGN (16);
0153         _rodata_start = . ;
0154         *(.rodata*)
0155         KEEP (*(SORT(.rtemsroset.*)))
0156         *(.gnu.linkonce.r*)
0157         
0158         . = ALIGN (16);
0159 
0160         *(.console_gdb_xfer)
0161         *(.bootstrap_data)
0162         . = ALIGN(16);
0163         _estuff = .;
0164     PROVIDE (_etext = .);
0165     } >ram
0166 
0167     .tdata : {
0168         _TLS_Data_begin = .;
0169         *(.tdata .tdata.* .gnu.linkonce.td.*)
0170         _TLS_Data_end = .;
0171     } >ram
0172 
0173     .tbss : {
0174         _TLS_BSS_begin = .;
0175         *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0176         _TLS_BSS_end = .;
0177     } >ram
0178 
0179     _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0180     _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0181     _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0182     _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0183     _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0184     _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0185         
0186         .data : {
0187             PROVIDE( _data_dest_start = . );
0188             PROVIDE( _copy_start = .);
0189             *(.data)
0190             KEEP (*(SORT(.rtemsrwset.*)))
0191             *(.gnu.linkonce.d*)
0192             *(.gcc_except_table*)
0193             *(.jcr)
0194             . = ALIGN (16);
0195             PROVIDE (_edata = .);
0196         PROVIDE (_copy_end = .);
0197         PROVIDE (_data_dest_end = . );
0198         } >ram
0199 
0200         _data_src_start = _estuff;
0201         _data_src_end = _data_dest_start + SIZEOF(.data);        
0202         
0203         .bss : {
0204                 _clear_start = .;
0205                 *(.bss*)
0206                 *(COMMON)
0207                 . = ALIGN (16);
0208                 PROVIDE (end = .);
0209                 _clear_end = .;
0210         } >ram
0211 
0212         .noinit (NOLOAD) : {
0213                 *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0214         } > ram
0215 
0216         .rtemsstack (NOLOAD) : {
0217                 *(SORT(.rtemsstack.*))
0218                 WorkAreaBase = .;
0219         } >ram
0220 
0221   /* Stabs debugging sections.  */
0222   .stab 0 : { *(.stab) }
0223   .stabstr 0 : { *(.stabstr) }
0224   .stab.excl 0 : { *(.stab.excl) }
0225   .stab.exclstr 0 : { *(.stab.exclstr) }
0226   .stab.index 0 : { *(.stab.index) }
0227   .stab.indexstr 0 : { *(.stab.indexstr) }
0228   .comment 0 : { *(.comment) }
0229 
0230 PROVIDE (end_of_all = .);  
0231 }