Ignore:
Timestamp:
Dec 3, 2010, 10:52:07 AM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
8353f94f
Parents:
dda95953
Message:

2010-12-03 Sebastian Huber <sebastian.huber@…>

  • bsp_specs, start/start.S, startup/linkcmds: Use linker command base file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/gdbarmsim/startup/linkcmds

    rdda95953 r8d992be  
    1 /*
    2  *  Cogent CSB336 Linker script
    3  *
    4  *  Copyright (c) 2004 by Cogent Computer Systems
    5  *  Written by Jay Monkman <jtm@lopingdog.com>
    6  *
    7  *  The license and distribution terms for this file may be
    8  *  found in the file LICENSE in this distribution or at
    9  *
    10  *  http://www.rtems.com/license/LICENSE.
    11  *
    12  *  $Id$
    13  */
    14 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
    15               "elf32-littlearm")
    16 OUTPUT_ARCH(arm)
    17 ENTRY(_start)
    18 /* SEARCH_DIR(/usr/local/rtems-arm-dev-tools/arm-rtems/lib); */
    19 
    20 
    211MEMORY {
    22         sdram : ORIGIN = 0x00000000, LENGTH = 4M
     2        RAM : ORIGIN = 0x00000000, LENGTH = 4M
     3        NIRVANA : ORIGIN = 0, LENGTH = 0
    234}
    245
    25 /*
    26  * Declare some sizes.
    27  */
     6REGION_ALIAS ("REGION_START", RAM);
     7REGION_ALIAS ("REGION_VECTOR", RAM);
     8REGION_ALIAS ("REGION_TEXT", RAM);
     9REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
     10REGION_ALIAS ("REGION_RODATA", RAM);
     11REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
     12REGION_ALIAS ("REGION_DATA", RAM);
     13REGION_ALIAS ("REGION_DATA_LOAD", RAM);
     14REGION_ALIAS ("REGION_FAST_TEXT", RAM);
     15REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);
     16REGION_ALIAS ("REGION_FAST_DATA", RAM);
     17REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
     18REGION_ALIAS ("REGION_BSS", RAM);
     19REGION_ALIAS ("REGION_WORK", RAM);
     20REGION_ALIAS ("REGION_STACK", RAM);
    2821
    29 /* The base for SDRAM is set to umon's APPRAMBASE */
    30 _sdram_base = DEFINED(_sdram_base) ? _sdram_base : 0x0;
    31 _sdram_size = DEFINED(_sdram_size) ? _sdram_size : 4M;
    32 
    33 RamBase = _sdram_base;
    34 RamSize = _sdram_size;
    35 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
    36 
    37 _irq_stack_size = DEFINED(_irq_stack_size) ? _irq_stack_size : 0x1000;
    38 _fiq_stack_size = DEFINED(_fiq_stack_size) ? _fiq_stack_size : 0x400;
    39 _abt_stack_size = DEFINED(_abt_stack_size) ? _abt_stack_size : 0x400;
    40 _undef_stack_size = DEFINED(_undef_stack_size) ? _undef_stack_size : 0x400;
    41 _svc_stack_size = DEFINED(_svc_stack_size) ? _svc_stack_size : 0x1000;
    42 
    43 
    44 
    45 /* Do we need any of these for elf?
    46    __DYNAMIC = 0;    */
    47 
    48 SECTIONS
    49 {
    50   .base :
    51   {
    52     arm_exception_table = .;   
    53 
    54     arm_reset_vect    = .;     /* 0x00 */
    55     . += 4;
    56 
    57     arm_undef_vect    = .;     /* 0x04 */
    58     . += 4;
    59 
    60     arm_swi_vect      = .;     /* 0x08 */
    61     . += 4;
    62 
    63     arm_iabrt_vect    = .;     /* 0x0c */
    64     . += 4;
    65 
    66     arm_dabrt_vect    = .;     /* 0x10 */
    67     . += 4;
    68 
    69     /* no vector here */
    70     . += 4;
    71 
    72     arm_irq_vect      = .;     /* 0x18 */
    73     . += 4;
    74 
    75     arm_fiq_vect      = .;     /* 0x1c */
    76     . += 4;
    77                               /* FIXME: */
    78 
    79     rtems_vector_table = .;
    80     . += (8 * 4);                     /* 8 ARM interrupts */
    81        
    82     . = ALIGN (0x100);
    83 
    84 
    85   } > sdram
    86 
    87   .text      :
    88   {
    89         . = 0x8000;
    90         _text_start = .;
    91          CREATE_OBJECT_SYMBOLS
    92         *(.text)
    93         *(.text.*)
    94 
    95         /*
    96          * Special FreeBSD sysctl sections.
    97          */
    98         . = ALIGN (16);
    99         __start_set_sysctl_set = .;
    100         *(set_sysctl_*);
    101         __stop_set_sysctl_set = ABSOLUTE(.);
    102         *(set_domain_*);
    103         *(set_pseudo_*);
    104 
    105         /* .gnu.warning sections are handled specially by elf32.em.  */
    106         *(.gnu.warning)
    107         *(.gnu.linkonce.t*)
    108         *(.glue_7)
    109         *(.glue_7t)
    110 
    111         /* I think these come from the ld docs: */     
    112         ___CTOR_LIST__ = .;
    113         LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)
    114         *(.ctors)
    115         LONG(0)
    116         ___CTOR_END__ = .;
    117         ___DTOR_LIST__ = .;
    118         LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)
    119         *(.dtors)
    120         LONG(0)
    121         ___DTOR_END__ = .;
    122 
    123         _etext = .;
    124         PROVIDE (etext = .);
    125   } > sdram 
    126 
    127   .init          :
    128   {
    129     KEEP (*(.init))
    130   } > sdram   /*=0*/
    131 
    132   .fini      :
    133   {
    134     KEEP (*(.fini))
    135   } > sdram  /*=0*/
    136 
    137   .data :
    138   {
    139     *(.data)
    140     *(.data.*)
    141     *(.gnu.linkonce.d*)
    142     *(.jcr)
    143     SORT(CONSTRUCTORS)
    144     _edata = .;
    145   } > sdram
    146 
    147   .eh_frame : { *(.eh_frame) } > sdram
    148   .data1   : { *(.data1) } > sdram
    149   .eh_frame : { *(.eh_frame) } > sdram
    150   .gcc_except_table : { *(.gcc_except_table*) } > sdram
    151 
    152   .rodata :
    153   {
    154     *(.rodata)
    155     *(.rodata.*)
    156     *(.gnu.linkonce.r*)
    157   } > sdram
    158 
    159   .bss       :
    160   {
    161         __bss_start__ = .;
    162         _bss_start_ = .;
    163         _clear_start = .;
    164         *(.bss)
    165         *(.bss.*)
    166         *(.gnu.linkonce.b.*)
    167         *(COMMON)
    168         . = ALIGN(64);
    169         _clear_end = .;
    170 
    171         . = ALIGN (256);
    172         _abt_stack = .;
    173         . += _abt_stack_size;
    174 
    175         . = ALIGN (256);
    176         _undef_stack = .;
    177         . += _undef_stack_size;
    178 
    179         . = ALIGN (256);
    180         _irq_stack = .;
    181         . += _irq_stack_size;
    182 
    183         . = ALIGN (256);
    184         _fiq_stack = .;
    185         . += _fiq_stack_size;
    186 
    187         . = ALIGN (256);
    188         _svc_stack = .;
    189         . += _svc_stack_size;
    190 
    191 /*
    192  * Ideally, the MMU's translation table would be in SRAM. But we
    193  * don't have any. If we don't use more regions than TLB entries (64),
    194  * the lookup will only happen once for each region.
    195  */
    196         . = ALIGN (16 * 1024);
    197         _ttbl_base = .;
    198         . += (16 * 1024);
    199 
    200         . = ALIGN (1024);
    201         _bss_free_start = .;
    202         WorkAreaBase = .;
    203 
    204         . = RamSize + RamBase - 1;
    205         __clear_end__ = .;
    206         __bss_end__ = .;
    207         _bss_end_ = .;
    208         _end = .;
    209         __end = .;
    210 
    211   } > sdram
    212 
    213 
    214 /* Debugging stuff follows? */
    215 
    216   /* Stabs debugging sections.  */
    217   .stab 0 : { *(.stab) }
    218   .stabstr 0 : { *(.stabstr) }
    219   .stab.excl 0 : { *(.stab.excl) }
    220   .stab.exclstr 0 : { *(.stab.exclstr) }
    221   .stab.index 0 : { *(.stab.index) }
    222   .stab.indexstr 0 : { *(.stab.indexstr) }
    223   .comment 0 : { *(.comment) }
    224   /* DWARF debug sections.
    225      Symbols in the DWARF debugging sections are relative to the beginning
    226      of the section so we begin them at 0.  */
    227   /* DWARF 1 */
    228   .debug          0 : { *(.debug) }
    229   .line           0 : { *(.line) }
    230   /* GNU DWARF 1 extensions */
    231   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    232   .debug_sfnames  0 : { *(.debug_sfnames) }
    233   /* DWARF 1.1 and DWARF 2 */
    234   .debug_aranges  0 : { *(.debug_aranges) }
    235   .debug_pubnames 0 : { *(.debug_pubnames) }
    236   /* DWARF 2 */
    237   .debug_info     0 : { *(.debug_info) }
    238   .debug_abbrev   0 : { *(.debug_abbrev) }
    239   .debug_line     0 : { *(.debug_line) }
    240   .debug_frame    0 : { *(.debug_frame) }
    241   .debug_str      0 : { *(.debug_str) }
    242   .debug_loc      0 : { *(.debug_loc) }
    243   .debug_macinfo  0 : { *(.debug_macinfo) }
    244   /* SGI/MIPS DWARF 2 extensions */
    245   .debug_weaknames 0 : { *(.debug_weaknames) }
    246   .debug_funcnames 0 : { *(.debug_funcnames) }
    247   .debug_typenames 0 : { *(.debug_typenames) }
    248   .debug_varnames  0 : { *(.debug_varnames) }
    249   /*.stack 0x80000 : { _stack = .; *(.stack) }*/
    250   /* These must appear regardless of  .  */
    251 }
    252 
     22INCLUDE linkcmds.armv4
Note: See TracChangeset for help on using the changeset viewer.