Back to home page

LXR

 
 

    


Warning, /bsps/sh/gensh4/start/linkcmds.rom2ram 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   rom : {
0058     copy_start_in_rom = .;
0059   } >rom
0060 
0061   /* Read-only sections, merged into text segment: */
0062   .init          : 
0063   { 
0064     KEEP (*(.init))
0065   } =0
0066   .text      : AT(copy_start_in_rom)
0067   {
0068     copy_start = .;
0069     *(.text*)
0070 
0071     /*
0072      * Special FreeBSD sysctl sections.
0073      */
0074     . = ALIGN (16);
0075     ___start_set_sysctl_set = .;
0076     *(set_sysc*);   /* set_sysctl_* but name is truncated by SH-coff */
0077     ___stop_set_sysctl_set = ABSOLUTE(.);
0078     *(set_doma*);   /* set_domain_* but name is truncated by SH-coff */
0079     *(set_pseudo_*);
0080 
0081     /* .gnu.warning sections are handled specially by elf32.em.  */
0082     *(.gnu.warning)
0083     *(.gnu.linkonce.t*)
0084   } > ram
0085   _etext = .;
0086   PROVIDE (etext = .);
0087   .fini      :
0088   {
0089     KEEP (*(.fini))
0090   } =0
0091   .rodata   :  AT(LOADADDR(.text) + SIZEOF(.text))
0092   { 
0093     *(.rodata) 
0094     *(.rodata.*) 
0095     KEEP (*(SORT(.rtemsroset.*)))
0096     *(.gnu.linkonce.r*) 
0097     . = ALIGN(32);
0098   } > ram
0099   .tdata : {
0100     __TLS_Data_begin = .;
0101     *(.tdata .tdata.* .gnu.linkonce.td.*)
0102     __TLS_Data_end = .;
0103   } > ram
0104   .tbss : {
0105     __TLS_BSS_begin = .;
0106     *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0107     __TLS_BSS_end = .;
0108   } > ram
0109   __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
0110   __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
0111   __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
0112   __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
0113   __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
0114   __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0115   .ctors   :  AT(LOADADDR(.rodata) + SIZEOF(.rodata))
0116   {
0117     ___ctors = .;
0118     /* gcc uses crtbegin.o to find the start of
0119        the constructors, so we make sure it is
0120        first.  Because this is a wildcard, it
0121        doesn't matter if the user does not
0122        actually link against crtbegin.o; the
0123        linker won't look for a file to match a
0124        wildcard.  The wildcard also means that it
0125        doesn't matter which directory crtbegin.o
0126        is in.  */
0127     KEEP (*crtbegin.o(.ctors))
0128     /* We don't want to include the .ctor section from
0129        from the crtend.o file until after the sorted ctors.
0130        The .ctor section from the crtend file contains the
0131        end of ctors marker and it must be last */
0132     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
0133     KEEP (*(SORT(.ctors.*)))
0134     KEEP (*(.ctors))
0135     ___ctors_end = .;
0136   } > ram
0137    .dtors         : AT(LOADADDR(.ctors) + SIZEOF(.ctors))
0138   {
0139     ___dtors = .;
0140     KEEP (*crtbegin.o(.dtors))
0141     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
0142     KEEP (*(SORT(.dtors.*)))
0143     KEEP (*(.dtors))
0144     ___dtors_end = .;
0145   } > ram
0146 
0147   /* Adjust the address for the data segment.  We want to adjust up to
0148      the same address within the page on the next page up.  */
0149   . = ALIGN(128) + (. & (128 - 1));
0150   .data     : AT(LOADADDR(.dtors) + SIZEOF(.dtors))
0151   {
0152     *(.data)
0153     *(.data.*)
0154     KEEP (*(SORT(.rtemsrwset.*)))
0155     *(.gnu.linkonce.d*)
0156     SORT(CONSTRUCTORS)
0157     copy_end = .;
0158   } > ram
0159   .eh_frame : { *(.eh_frame) } > ram
0160   /* We want the small data sections together, so single-instruction offsets
0161      can access them all, and initialized data all before uninitialized, so
0162      we can shorten the on-disk segment size.  */
0163   .bss       :
0164   {
0165    __bss_start = .;
0166    *(.dynbss)
0167    *(.bss .bss* .gnu.linkonce.b*)
0168    *(COMMON)
0169    /* Align here to ensure that the .bss section occupies space up to
0170       _end.  Align after .bss to ensure correct alignment even if the
0171       .bss section disappears because there are no input sections.  */
0172    . = ALIGN(32 / 8);
0173    __bss_end = .;
0174   } > ram
0175 
0176   .rela.dyn       :
0177     {
0178       *(.rela.init)
0179       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
0180       *(.rela.fini)
0181       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
0182       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
0183       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
0184       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
0185       *(.rela.ctors)
0186       *(.rela.dtors)
0187       *(.rela.got)
0188       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
0189       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
0190       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
0191       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
0192       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
0193     } >ram
0194 
0195   .noinit (NOLOAD) : {
0196     *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0197   } > ram
0198 
0199   .rtemsstack (NOLOAD) : {
0200     *(SORT(.rtemsstack.*))
0201   } > ram
0202 
0203   _WorkAreaBase = . ;
0204 
0205   /* Stabs debugging sections.  */
0206   .stab 0 : { *(.stab) }
0207   .stabstr 0 : { *(.stabstr) }
0208   .stab.excl 0 : { *(.stab.excl) }
0209   .stab.exclstr 0 : { *(.stab.exclstr) }
0210   .stab.index 0 : { *(.stab.index) }
0211   .stab.indexstr 0 : { *(.stab.indexstr) }
0212   .comment 0 : { *(.comment) }
0213   /* DWARF debug sections.
0214      Symbols in the DWARF debugging sections are relative to the beginning
0215      of the section so we begin them at 0.  */
0216   /* DWARF 1 */
0217   .debug          0 : { *(.debug) }
0218   .line           0 : { *(.line) }
0219   /* GNU DWARF 1 extensions */
0220   .debug_srcinfo  0 : { *(.debug_srcinfo) }
0221   .debug_sfnames  0 : { *(.debug_sfnames) }
0222   /* DWARF 1.1 and DWARF 2 */
0223   .debug_aranges  0 : { *(.debug_aranges) }
0224   .debug_pubnames 0 : { *(.debug_pubnames) }
0225   /* DWARF 2 */
0226   .debug_info     0 : { *(.debug_info) }
0227   .debug_abbrev   0 : { *(.debug_abbrev) }
0228   .debug_line     0 : { *(.debug_line) }
0229   .debug_frame    0 : { *(.debug_frame) }
0230   .debug_str      0 : { *(.debug_str) }
0231   .debug_loc      0 : { *(.debug_loc) }
0232   .debug_macinfo  0 : { *(.debug_macinfo) }
0233   /* SGI/MIPS DWARF 2 extensions */
0234   .debug_weaknames 0 : { *(.debug_weaknames) }
0235   .debug_funcnames 0 : { *(.debug_funcnames) }
0236   .debug_typenames 0 : { *(.debug_typenames) }
0237   .debug_varnames  0 : { *(.debug_varnames) }
0238   /* These must appear regardless of  .  */
0239 }