Back to home page

LXR

 
 

    


Warning, /bsps/sh/gensh4/start/linkcmds.rom is written in an unsupported language. File is not indexed.

0001 /*
0002  * This file contains GNU linker directives for an general SH4 
0003  * board.
0004  *
0005  * Variations in memory size and allocation can be made by
0006  * overriding some values with linker command-line arguments.
0007  *
0008  * Copyright (C) 2000 OKTET Ltd., St.-Petersburg, Russia
0009  * Author: Victor V. Vengerov <vvv@oktet.ru>
0010  *
0011  * The license and distribution terms for this file may be
0012  * found in the file LICENSE in this distribution or at
0013  *
0014  * http://www.rtems.org/license/LICENSE.
0015  */
0016 
0017 
0018 OUTPUT_FORMAT("elf32-shl", "elf32-shl",
0019               "elf32-shl")
0020 OUTPUT_ARCH(sh)
0021 ENTRY(_start)
0022 STARTUP(start.o)
0023 
0024 /* Do we need any of these for elf?
0025    __DYNAMIC = 0;    */
0026 
0027 _RamBase = DEFINED(_RamBase) ? _RamBase : 0x88000000;
0028 _RamSize = DEFINED(_RamSize) ? _RamSize : 8M;
0029 _RamEnd = _RamBase + _RamSize;
0030 _HeapSize = DEFINED(_HeapSize) ? _HeapSize : (2 * 1024 * 1024);
0031 
0032 /*
0033  * Area assignments:
0034  *     Area 0: Flash memory, SRAM interface
0035  *     Area 1: GDC
0036  *     Area 2: SDRAM
0037  *     Area 3-6: unused
0038  */
0039 MEMORY
0040 {
0041 /*
0042  * Real values
0043  */
0044   ram           : o = 0x88000000, l = 8M
0045   rom           : o = 0x80000000, l = 4M
0046 /*
0047  * Fake values to test from gdb
0048  */
0049 /*
0050   ram           : o = 0x88100000, l = 4M
0051   rom           : o = 0x88500000, l = 3M
0052 */
0053 }
0054 
0055 SECTIONS
0056 {
0057   /* Read-only sections, merged into text segment: */
0058   .init          : 
0059   { 
0060     KEEP (*(.init))
0061   } =0
0062   .text      :
0063   {
0064     *(.text*)
0065 
0066     /*
0067      * Special FreeBSD sysctl sections.
0068      */
0069     . = ALIGN (16);
0070     ___start_set_sysctl_set = .;
0071     *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
0072     ___stop_set_sysctl_set = ABSOLUTE(.);
0073     *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
0074     *(set_pseudo_*);
0075 
0076     /* .gnu.warning sections are handled specially by elf32.em.  */
0077     *(.gnu.warning)
0078     *(.gnu.linkonce.t*)
0079   } > rom
0080   _etext = .;
0081   PROVIDE (etext = .);
0082   .rela.dyn       :
0083     {
0084       *(.rela.init)
0085       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
0086       *(.rela.fini)
0087       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
0088       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
0089       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
0090       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
0091       *(.rela.ctors)
0092       *(.rela.dtors)
0093       *(.rela.got)
0094       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
0095       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
0096       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
0097       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
0098       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
0099     } >ram
0100   .fini      :
0101   {
0102     KEEP (*(.fini))
0103   } =0
0104   .rodata   : 
0105   { 
0106     *(.rodata) 
0107     *(.rodata.*) 
0108     KEEP (*(SORT(.rtemsroset.*)))
0109     *(.gnu.linkonce.r*) 
0110     . = ALIGN(32);
0111   } > rom
0112   .tdata : {
0113     __TLS_Data_begin = .;
0114     *(.tdata .tdata.* .gnu.linkonce.td.*)
0115     __TLS_Data_end = .;
0116   } > rom
0117   .tbss : {
0118     __TLS_BSS_begin = .;
0119     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0120     __TLS_BSS_end = .;
0121   } > rom
0122   __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
0123   __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
0124   __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
0125   __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
0126   __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
0127   __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0128   .ctors   : 
0129   {
0130     ___ctors = .;
0131     /* gcc uses crtbegin.o to find the start of
0132        the constructors, so we make sure it is
0133        first.  Because this is a wildcard, it
0134        doesn't matter if the user does not
0135        actually link against crtbegin.o; the
0136        linker won't look for a file to match a
0137        wildcard.  The wildcard also means that it
0138        doesn't matter which directory crtbegin.o
0139        is in.  */
0140     KEEP (*crtbegin.o(.ctors))
0141     /* We don't want to include the .ctor section from
0142        from the crtend.o file until after the sorted ctors.
0143        The .ctor section from the crtend file contains the
0144        end of ctors marker and it must be last */
0145     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
0146     KEEP (*(SORT(.ctors.*)))
0147     KEEP (*(.ctors))
0148     ___ctors_end = .;
0149   } > rom
0150    .dtors         :
0151   {
0152     ___dtors = .;
0153     KEEP (*crtbegin.o(.dtors))
0154     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
0155     KEEP (*(SORT(.dtors.*)))
0156     KEEP (*(.dtors))
0157     ___dtors_end = .;
0158     copy_start_in_rom = .;
0159   } > rom
0160 
0161   /* Adjust the address for the data segment.  We want to adjust up to
0162      the same address within the page on the next page up.  */
0163   . = ALIGN(128) + (. & (128 - 1));
0164   .data     : AT(LOADADDR(.dtors) + SIZEOF(.dtors))
0165   {
0166     copy_start = .;
0167     *(.data)
0168     *(.data.*)
0169     KEEP (*(SORT(.rtemsrwset.*)))
0170     *(.gnu.linkonce.d*)
0171     SORT(CONSTRUCTORS)
0172     copy_end = .;
0173   } > ram
0174   .eh_frame : { *(.eh_frame) } > ram
0175   /* We want the small data sections together, so single-instruction offsets
0176      can access them all, and initialized data all before uninitialized, so
0177      we can shorten the on-disk segment size.  */
0178   .bss       :
0179   {
0180    __bss_start = .;
0181    *(.dynbss)
0182    *(.bss .bss* .gnu.linkonce.b*)
0183    *(COMMON)
0184    /* Align here to ensure that the .bss section occupies space up to
0185       _end.  Align after .bss to ensure correct alignment even if the
0186       .bss section disappears because there are no input sections.  */
0187    . = ALIGN(32 / 8);
0188    __bss_end = .;
0189   } > ram
0190 
0191   .noinit (NOLOAD) : {
0192     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0193   } > ram
0194 
0195   .rtemsstack (NOLOAD) : {
0196     *(SORT(.rtemsstack.*))
0197   } > ram
0198 
0199   _WorkAreaBase = . ;
0200 
0201   /* Stabs debugging sections.  */
0202   .stab 0 : { *(.stab) }
0203   .stabstr 0 : { *(.stabstr) }
0204   .stab.excl 0 : { *(.stab.excl) }
0205   .stab.exclstr 0 : { *(.stab.exclstr) }
0206   .stab.index 0 : { *(.stab.index) }
0207   .stab.indexstr 0 : { *(.stab.indexstr) }
0208   .comment 0 : { *(.comment) }
0209   /* DWARF debug sections.
0210      Symbols in the DWARF debugging sections are relative to the beginning
0211      of the section so we begin them at 0.  */
0212   /* DWARF 1 */
0213   .debug          0 : { *(.debug) }
0214   .line           0 : { *(.line) }
0215   /* GNU DWARF 1 extensions */
0216   .debug_srcinfo  0 : { *(.debug_srcinfo) }
0217   .debug_sfnames  0 : { *(.debug_sfnames) }
0218   /* DWARF 1.1 and DWARF 2 */
0219   .debug_aranges  0 : { *(.debug_aranges) }
0220   .debug_pubnames 0 : { *(.debug_pubnames) }
0221   /* DWARF 2 */
0222   .debug_info     0 : { *(.debug_info) }
0223   .debug_abbrev   0 : { *(.debug_abbrev) }
0224   .debug_line     0 : { *(.debug_line) }
0225   .debug_frame    0 : { *(.debug_frame) }
0226   .debug_str      0 : { *(.debug_str) }
0227   .debug_loc      0 : { *(.debug_loc) }
0228   .debug_macinfo  0 : { *(.debug_macinfo) }
0229   /* SGI/MIPS DWARF 2 extensions */
0230   .debug_weaknames 0 : { *(.debug_weaknames) }
0231   .debug_funcnames 0 : { *(.debug_funcnames) }
0232   .debug_typenames 0 : { *(.debug_typenames) }
0233   .debug_varnames  0 : { *(.debug_varnames) }
0234   /* These must appear regardless of  .  */
0235 }