Back to home page

LXR

 
 

    


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

0001 /*
0002  *  This file contains directives for the GNU linker which are specific
0003  *  to the Arcturus uC DIMM ColdFire 5282
0004  */
0005 
0006 /*
0007  * Copyright (c) 2005 Eric Norum <eric@norum.ca>
0008  *
0009  * COPYRIGHT (c) 2005-2007.
0010  * On-Line Applications Research Corporation (OAR).
0011  *
0012  * The license and distribution terms for this file may be
0013  * found in the file LICENSE in this distribution or at
0014  * http://www.rtems.org/license/LICENSE.
0015  */
0016 
0017 /*
0018  * Declare some locations and sizes.
0019  */
0020 RamBase = DEFINED(RamBase) ? RamBase : 0x0;
0021 RamSize = DEFINED(RamSize) ? RamSize : 16M;
0022 RamEnd = RamBase + RamSize;
0023 HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
0024 _FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000;
0025 _FlashSize = DEFINED(_FlashSize) ? _FlashSize : 4M ;
0026 
0027 /*
0028  * Location of downloaded (from TFTP or flash) file
0029  */
0030 _DownloadLocation = 0x40000;
0031 
0032 /*
0033  * System clock speed
0034  *
0035  * If autodetection of the system clock pased on the PLL ref. clock
0036  * (AFAIK 8MHz for both 64MHz and 80MHz boards) doesn't work then
0037  * you can:
0038  *   - define (nonzero) system clock speed from app- linkflags (or here)
0039  *   - use a uCbootloader env. var: SYS_CLOCK_SPEED to define it.
0040  * You can also redefine the PLL reference clock speed from linkflags
0041  * or here...
0042  */
0043 _CPUClockSpeed    = DEFINED(_CPUClockSpeed)    ? _CPUClockSpeed : 0 ;
0044 _PLLRefClockSpeed = DEFINED(_PLLRefClockSpeed) ? _PLLRefClockSpeed : 8000000;
0045 
0046 /*
0047  * Location of on-chip devices
0048  */
0049 __IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ;
0050 __SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ;
0051 _VBR = 0x0;
0052 
0053 ENTRY(start)
0054 STARTUP(start.o)
0055 
0056 MEMORY
0057 {
0058     ram : ORIGIN = 0, LENGTH = 16M
0059     sram : ORIGIN = 0x20000000, LENGTH = 64k
0060 }
0061 
0062 SECTIONS
0063 {
0064 
0065     _header_offset = 0;
0066 
0067     /*
0068      * Text, data and bss segments
0069      */
0070     .text _DownloadLocation : {
0071 
0072         *(.text*)
0073         *(.ram_code)
0074 
0075         /*
0076          * C++ constructors/destructors
0077          */
0078         *(.gnu.linkonce.t.*)
0079 
0080         /*
0081          * Initialization and finalization code.
0082          *
0083          * Various files can provide initialization and finalization
0084          * functions.  crtbegin.o and crtend.o are two instances. The
0085          * body of these functions are in .init and .fini sections. We
0086          * accumulate the bodies here, and prepend function prologues
0087          * from crti.o and function epilogues from crtn.o. crti.o must
0088          * be linked first; crtn.o must be linked last.  Because these
0089          * are wildcards, it doesn't matter if the user does not
0090          * actually link against crti.o and crtn.o; the linker won't
0091          * look for a file to match a wildcard.  The wildcard also
0092          * means that it doesn't matter which directory crti.o and
0093          * crtn.o are in.
0094          */
0095         PROVIDE (_init = .);
0096         KEEP (*crti.o(.init))
0097         KEEP (*(.init))
0098         KEEP (*crtn.o(.init))
0099         PROVIDE (_fini = .);
0100         KEEP (*crti.o(.fini))
0101         KEEP (*(.fini))
0102         KEEP (*crtn.o(.fini))
0103 
0104         /*
0105          * Special FreeBSD sysctl sections.
0106          */
0107         . = ALIGN (16);
0108         __start_set_sysctl_set = .;
0109         *(set_sysctl_*);
0110         __stop_set_sysctl_set = ABSOLUTE(.);
0111         *(set_domain_*);
0112         *(set_pseudo_*);
0113 
0114         /*
0115          * C++ constructors/destructors
0116          *
0117          * gcc uses crtbegin.o to find the start of the constructors
0118          * and destructors so we make sure it is first.  Because this
0119          * is a wildcard, it doesn't matter if the user does not
0120          * actually link against crtbegin.o; the linker won't look for
0121          * a file to match a wildcard.  The wildcard also means that
0122          * it doesn't matter which directory crtbegin.o is in. The
0123          * constructor and destructor list are terminated in
0124          * crtend.o.  The same comments apply to it.
0125          */
0126         . = ALIGN (16);
0127         KEEP (*crtbegin.o(.ctors))
0128         KEEP (*crtbegin?.o(.ctors))
0129         KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
0130         KEEP (*(SORT(.ctors.*)))
0131         KEEP (*(.ctors))
0132         KEEP (*crtbegin.o(.dtors))
0133         KEEP (*crtbegin?.o(.dtors))
0134         KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
0135         KEEP (*(SORT(.dtors.*)))
0136         KEEP (*(.dtors))
0137 
0138         /*
0139          * Exception frame info
0140          */
0141         . = ALIGN (16);
0142         KEEP (*(.eh_frame))
0143 
0144         /*
0145          * Read-only data
0146          */
0147         . = ALIGN (16);
0148         _rodata_start = . ;
0149         *(.rodata*)
0150         KEEP (*(SORT(.rtemsroset.*)))
0151         *(.gnu.linkonce.r*)
0152 
0153         . = ALIGN (16);
0154 
0155         *(.console_gdb_xfer)
0156         *(.bootstrap_data)
0157         . = ALIGN(16);
0158         _estuff = .;
0159         PROVIDE (_etext = .);
0160     } >ram
0161 
0162     .tdata : {
0163         _TLS_Data_begin = .;
0164         *(.tdata .tdata.* .gnu.linkonce.td.*)
0165         _TLS_Data_end = .;
0166     } > ram
0167 
0168     .tbss : {
0169         _TLS_BSS_begin = .;
0170         *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0171         _TLS_BSS_end = .;
0172     } > ram
0173 
0174     _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0175     _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0176     _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0177     _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0178     _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0179     _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0180 
0181     .data : {
0182         PROVIDE( _data_dest_start = . );
0183         PROVIDE( _copy_start = .);
0184         *(.data*)
0185         KEEP (*(SORT(.rtemsrwset.*)))
0186         *(.gnu.linkonce.d*)
0187         *(.gcc_except_table*)
0188         KEEP (*(.jcr))
0189         . = ALIGN (16);
0190         PROVIDE (_edata = .);
0191         PROVIDE (_copy_end = .);
0192         PROVIDE (_data_dest_end = . );
0193     } >ram
0194 
0195     _data_src_start = LOADADDR(.data);
0196     _data_src_end = _data_src_start + SIZEOF(.data);
0197 
0198     .bss : {
0199         _clear_start = .;
0200         *(.bss*)
0201         *(.gnu.linkonce.b.*)
0202         *(COMMON)
0203         . = ALIGN (16);
0204         PROVIDE (end = .);
0205         _clear_end = .;
0206     } >ram
0207 
0208     .noinit (NOLOAD) : {
0209        *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0210     } >ram
0211 
0212     .rtemsstack (NOLOAD) : {
0213         *(SORT(.rtemsstack.*))
0214         WorkAreaBase = .;
0215     } >ram
0216 
0217   /* Stabs debugging sections.  */
0218   .stab 0 : { *(.stab) }
0219   .stabstr 0 : { *(.stabstr) }
0220   .stab.excl 0 : { *(.stab.excl) }
0221   .stab.exclstr 0 : { *(.stab.exclstr) }
0222   .stab.index 0 : { *(.stab.index) }
0223   .stab.indexstr 0 : { *(.stab.indexstr) }
0224   .comment 0 : { *(.comment) }
0225 
0226   /* DWARF debug sections.
0227      Symbols in the DWARF debugging sections are relative to the beginning
0228      of the section so we begin them at 0.  */
0229   /* DWARF 1 */
0230   .debug          0 : { *(.debug) }
0231   .line           0 : { *(.line) }
0232 
0233   /* GNU DWARF 1 extensions */
0234   .debug_srcinfo  0 : { *(.debug_srcinfo) }
0235   .debug_sfnames  0 : { *(.debug_sfnames) }
0236 
0237   /* DWARF 1.1 and DWARF 2 */
0238   .debug_aranges  0 : { *(.debug_aranges) }
0239   .debug_pubnames 0 : { *(.debug_pubnames) }
0240 
0241   /* DWARF 2 */
0242   .debug_info     0 : { *(.debug_info) }
0243   .debug_abbrev   0 : { *(.debug_abbrev) }
0244   .debug_line     0 : { *(.debug_line) }
0245   .debug_frame    0 : { *(.debug_frame) }
0246   .debug_str      0 : { *(.debug_str) }
0247   .debug_loc      0 : { *(.debug_loc) }
0248   .debug_macinfo  0 : { *(.debug_macinfo) }
0249 
0250   /* SGI/MIPS DWARF 2 extensions */
0251   .debug_weaknames 0 : { *(.debug_weaknames) }
0252   .debug_funcnames 0 : { *(.debug_funcnames) }
0253   .debug_typenames 0 : { *(.debug_typenames) }
0254   .debug_varnames  0 : { *(.debug_varnames) }
0255   /* These must appear regardless of  .  */
0256 
0257   /* Addition to let linker know about custom section for GDB pretty-printing support. */
0258   .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0259   
0260 PROVIDE (end_of_all = .);
0261 }