Changeset 6457fb29 in rtems for c/src


Ignore:
Timestamp:
03/19/13 09:12:06 (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
7b14e8b
Parents:
5f745464
git-author:
Sebastian Huber <sebastian.huber@…> (03/19/13 09:12:06)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/19/13 14:15:45)
Message:

bsp/psim: Use shared linkcmds.base

Several GCC tests faild due to the outdated previous linker command
file.

Location:
c/src/lib/libbsp/powerpc/psim
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/psim/Makefile.am

    r5f745464 r6457fb29  
    1010include_HEADERS += include/tm27.h
    1111include_HEADERS += include/psim.h
     12
     13include_bsp_HEADERS = ../shared/include/linker-symbols.h
    1214
    1315nodist_include_HEADERS = include/bspopts.h
     
    2426project_lib_DATA += rtems_crti.$(OBJEXT)
    2527
     28dist_project_lib_DATA += ../shared/startup/linkcmds.base
    2629dist_project_lib_DATA += startup/linkcmds
    2730
     
    3336    ../../shared/bsppost.c ../../shared/bsppretaskinghook.c \
    3437    ../../shared/bsppredriverhook.c startup/bspstart.c \
    35     ../../powerpc/shared/startup/bspgetworkarea.c ../../shared/bootcard.c \
     38    ../../shared/bspgetworkarea.c ../../shared/bootcard.c \
    3639    ../../powerpc/shared/startup/sbrk.c ../../shared/gnatinstallhandler.c \
    3740    startup/psim_registers.c
     
    4548
    4649# irq
    47 include_bsp_HEADERS = irq/irq.h ../shared/openpic/openpic.h \
     50include_bsp_HEADERS += irq/irq.h ../shared/openpic/openpic.h \
    4851    ../../shared/include/irq-generic.h
    4952libbsp_a_SOURCES += irq/irq_init.c ../shared/irq/openpic_i8259_irq.c \
  • c/src/lib/libbsp/powerpc/psim/configure.ac

    r5f745464 r6457fb29  
    4646and a little memory is saved.])
    4747
     48RTEMS_BSPOPTS_SET([BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN],[*],[1])
     49RTEMS_BSPOPTS_HELP([BSP_INTERRUPT_STACK_AT_WORK_AREA_BEGIN],[indicate that the interrupt stack is at the work area begin])
     50
    4851RTEMS_BSP_CLEANUP_OPTIONS(0, 1, 1)
    4952
  • c/src/lib/libbsp/powerpc/psim/preinstall.am

    r5f745464 r6457fb29  
    5050PREINSTALL_FILES += $(PROJECT_INCLUDE)/psim.h
    5151
     52$(PROJECT_INCLUDE)/bsp/linker-symbols.h: ../shared/include/linker-symbols.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
     53        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/linker-symbols.h
     54PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/linker-symbols.h
     55
    5256$(PROJECT_INCLUDE)/bspopts.h: include/bspopts.h $(PROJECT_INCLUDE)/$(dirstamp)
    5357        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bspopts.h
     
    6973        $(INSTALL_DATA) $< $(PROJECT_LIB)/rtems_crti.$(OBJEXT)
    7074TMPINSTALL_FILES += $(PROJECT_LIB)/rtems_crti.$(OBJEXT)
     75
     76$(PROJECT_LIB)/linkcmds.base: ../shared/startup/linkcmds.base $(PROJECT_LIB)/$(dirstamp)
     77        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.base
     78PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.base
    7179
    7280$(PROJECT_LIB)/linkcmds: startup/linkcmds $(PROJECT_LIB)/$(dirstamp)
  • c/src/lib/libbsp/powerpc/psim/start/start.S

    r5f745464 r6457fb29  
    4242
    4343.Lbss_start = .-.LCTOC1
    44         .long   __bss_start
     44        .long   bsp_section_sbss_begin
    4545
    4646.Lend = .-.LCTOC1
    47         .long   _end
     47        .long   bsp_section_bss_end
    4848
    4949.Lstack = .-.LCTOC1                     /* stack address if set by user */
     
    133133.Lstart:
    134134        .size   _start,.Lstart-_start
     135
     136        /* Start stack area */
     137.section ".bsp_rwextra", "aw", @nobits
     138.align 4
     139.space 4096
     140__stack:
  • c/src/lib/libbsp/powerpc/psim/startup/bspstart.c

    r5f745464 r6457fb29  
    1919#include <psim.h>
    2020#include <bsp/bootcard.h>
     21#include <bsp/linker-symbols.h>
    2122#include <rtems/bspIo.h>
    2223#include <rtems/powerpc/powerpc.h>
     
    7879void bsp_start( void )
    7980{
    80   uintptr_t intrStackStart;
    81   uintptr_t intrStackSize;
    82 
    8381  /*
    8482   * Note we can not get CPU identification dynamically.
     
    102100
    103101  /*
    104    * Initialize the interrupt related settings.
    105    */
    106   intrStackStart = (uintptr_t) __rtems_end;
    107   intrStackSize = rtems_configuration_get_interrupt_stack_size();
    108 
    109   /*
    110102   * Initialize default raw exception handlers.
    111103   */
    112104  ppc_exc_initialize(
    113105    PPC_INTERRUPT_DISABLE_MASK_DEFAULT,
    114     intrStackStart,
    115     intrStackSize
     106    (uintptr_t) bsp_section_work_begin,
     107    rtems_configuration_get_interrupt_stack_size()
    116108  );
    117109
  • c/src/lib/libbsp/powerpc/psim/startup/linkcmds

    r5f745464 r6457fb29  
    88 */
    99
    10 OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
    11 OUTPUT_ARCH(powerpc)
    12 ENTRY(_start)
    13 /* Do we need any of these for elf?
    14    __DYNAMIC = 0;    */
     10MEMORY {
     11        RAM       : ORIGIN = 0, LENGTH = 16M
     12        PSIM_REGS : ORIGIN = 0x0c000000, LENGTH = 16M
     13        EMPTY     : ORIGIN = 0x0, LENGTH = 0
     14}
     15
     16REGION_ALIAS ("REGION_START", RAM);
     17REGION_ALIAS ("REGION_FAST_TEXT", RAM);
     18REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM);
     19REGION_ALIAS ("REGION_TEXT", RAM);
     20REGION_ALIAS ("REGION_TEXT_LOAD", RAM);
     21REGION_ALIAS ("REGION_RODATA", RAM);
     22REGION_ALIAS ("REGION_RODATA_LOAD", RAM);
     23REGION_ALIAS ("REGION_FAST_DATA", RAM);
     24REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM);
     25REGION_ALIAS ("REGION_DATA", RAM);
     26REGION_ALIAS ("REGION_DATA_LOAD", RAM);
     27REGION_ALIAS ("REGION_BSS", RAM);
     28REGION_ALIAS ("REGION_RWEXTRA", RAM);
     29REGION_ALIAS ("REGION_WORK", RAM);
     30REGION_ALIAS ("REGION_STACK", RAM);
     31REGION_ALIAS ("REGION_NOCACHE", EMPTY);
     32REGION_ALIAS ("REGION_NOCACHE_LOAD", EMPTY);
     33REGION_ALIAS ("REGION_NVRAM", EMPTY);
     34
    1535PROVIDE (PSIM_INSTRUCTIONS_PER_MICROSECOND = 10000);
    1636
    17 RamBase = DEFINED(RamBase) ? RamBase : 0x0;
    18 /*
    19  * make sure device tree (property /openprom/options/oea-memory-size)
    20  * provides at least 'RamSize'.
    21  * Also, the BATs must at map at least 'RamSize' (currently, they
    22  * map 32M -- see startup/bspstart.c).
    23  * Furthermore, the RAM region must be large enough (there is no
    24  * disadvantage in making that one very large as long as it doesn't
    25  * overlap another memory area).
    26  *
    27  */
    28 RamSize = DEFINED(RamSize) ? RamSize : 16M;
     37SECTIONS {
     38        /*
     39         * BSP: PSIM Register Block
     40         */
     41        .psim_regs (NOLOAD) : {
     42                psim_reg*(.text)
     43                psim_reg*(.data)
     44                psim_reg*(.bss)
     45                psim_reg*(COMMON)
     46        } > PSIM_REGS
     47}
    2948
    30 MEMORY
    31   {
    32         RAM       : ORIGIN = 0, LENGTH = 32M
    33         PSIM_REGS : ORIGIN = 0x0c000000, LENGTH = 16M
    34         VECTORS   : ORIGIN = 0xFFF00000, LENGTH = 0x20000
    35   }
    36 
    37 SECTIONS
    38 {
    39   .entry_point_section :
    40   {
    41         *(.entry_point_section)
    42   } > VECTORS
    43 
    44   /*
    45    * BSP: PSIM Register Block
    46    */
    47   .psim_regs (NOLOAD) : {
    48     psim_reg*(.text)
    49     psim_reg*(.data)
    50     psim_reg*(.bss)
    51     psim_reg*(COMMON)
    52   } > PSIM_REGS
    53 
    54   /* Read-only sections, merged into text segment: */
    55   /* . = 0x40000 + SIZEOF_HEADERS; */
    56   . = 0x4000;
    57   .interp         : { *(.interp) }
    58   .hash           : { *(.hash) }
    59   .dynsym         : { *(.dynsym) }
    60   .dynstr         : { *(.dynstr) }
    61   .gnu.version    : { *(.gnu.version) }
    62   .gnu.version_d  : { *(.gnu.version_d) }
    63   .gnu.version_r  : { *(.gnu.version_r) }
    64   .text      :
    65   {
    66     *(.text*)
    67     *(.gnu.linkonce.t.*)
    68     *(.descriptors)
    69     *(.eh_frame_hdr*)
    70     *(.eh_frame*)
    71 
    72     /* .gnu.warning sections are handled specially by elf32.em.  */
    73     *(.gnu.warning)
    74   } >RAM
    75         .robsdsets : {
    76                 /* Special FreeBSD linker set sections */
    77                 __start_set_sysctl_set = .;
    78                 *(set_sysctl_*);
    79                 __stop_set_sysctl_set = .;
    80                 *(set_domain_*);
    81                 *(set_pseudo_*);
    82                 _bsd__start_set_modmetadata_set = .;
    83                 *(_bsd_set_modmetadata_set);
    84                 _bsd__stop_set_modmetadata_set = .;
    85                 _bsd__start_set_sysctl_set = .;
    86                 *(_bsd_set_sysctl_set);
    87                 _bsd__stop_set_sysctl_set = .;
    88                 _bsd__start_set_sysinit_set = .;
    89                 *(_bsd_set_sysinit_*);
    90                 _bsd__stop_set_sysinit_set = .;
    91 
    92                 bsp_section_rodata_end = .;
    93         } > RAM
    94   .init           :
    95   {
    96     KEEP (*(.init))
    97   } >RAM =0
    98 
    99   .rel.dyn        :
    100     {
    101       *(.rel.init)
    102       *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
    103       *(.rel.fini)
    104       *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
    105       *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
    106       *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
    107       *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
    108       *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
    109       *(.rel.ctors)
    110       *(.rel.dtors)
    111       *(.rel.got)
    112       *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
    113       *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
    114       *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
    115       *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
    116       *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
    117     } >RAM
    118   .rela.dyn       :
    119     {
    120       *(.rela.init)
    121       *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
    122       *(.rela.fini)
    123       *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
    124       *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
    125       *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
    126       *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
    127       *(.rela.ctors)
    128       *(.rela.dtors)
    129       *(.rela.got)
    130       *(.rela.got1)
    131       *(.rela.got2)
    132       *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
    133       *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
    134       *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
    135       *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
    136       *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    137     } >RAM
    138   .rel.plt        : { *(.rel.plt) }
    139   .rela.plt       : { *(.rela.plt) }
    140 
    141   .fini           :
    142   {
    143     _fini = .;
    144     KEEP (*(.fini))
    145   } >RAM =0
    146   .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) } >RAM
    147   .rodata1        : { *(.rodata1)       } >RAM
    148   PROVIDE (__FRAME_BEGIN__ = .);
    149   PROVIDE (__FRAME_END__ = .);
    150   PROVIDE (_etext = .);
    151   PROVIDE (etext = .);
    152 _SDA2_BASE_ = __SDATA2_START__ + 0x8000;
    153   .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >RAM
    154   .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >RAM
    155   PROVIDE (__SBSS2_END__ = .);
    156   /* Adjust the address for the data segment.  We want to adjust up to
    157      the same address within the page on the next page up.  It would
    158      be more correct to do this:
    159        . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
    160      The current expression does not correctly handle the case of a
    161      text segment ending precisely at the end of a page; it causes the
    162      data segment to skip a page.  The above expression does not have
    163      this problem, but it will currently (2/95) cause BFD to allocate
    164      a single segment, combining both text and data, for this case.
    165      This will prevent the text segment from being shared among
    166      multiple executions of the program; I think that is more
    167      important than losing a page of the virtual address space (note
    168      that no actual memory is lost; the page which is skipped can not
    169      be referenced).  */
    170   /* . =  ALIGN(8) + 0x40000; */
    171   .data    :
    172   {
    173     *(.data .data.* .gnu.linkonce.d.*)
    174     SORT(CONSTRUCTORS)
    175   } >RAM
    176   PROVIDE (__EXCEPT_START__ = .);
    177   .gcc_except_table   : { *(.gcc_except_table*) } >RAM
    178   PROVIDE (__EXCEPT_END__ = .);
    179 
    180   .data1          : { *(.data1)         } >RAM
    181   .got1           : { *(.got1)          } >RAM
    182   .dynamic        : { *(.dynamic)       } >RAM
    183   /* Put .ctors and .dtors next to the .got2 section, so that the pointers
    184      get relocated with -mrelocatable. Also put in the .fixup pointers.
    185      The current compiler no longer needs this, but keep it around for 2.7.2  */
    186    PROVIDE (__GOT2_START__ = .);
    187    PROVIDE (_GOT2_START_ = .);
    188   .got2           :  { *(.got2)         } >RAM
    189   PROVIDE (__GOT2_END__ = .);
    190   PROVIDE (_GOT2_END_ = .);
    191 
    192   PROVIDE (__CTOR_LIST__ = .);
    193   .ctors          : { *(.ctors)         } >RAM
    194   PROVIDE (__CTOR_END__ = .);
    195 
    196   PROVIDE (__DTOR_LIST__ = .);
    197   .dtors          : { *(.dtors)         } >RAM
    198   PROVIDE (__DTOR_END__ = .);
    199 
    200   PROVIDE (__FIXUP_START__ = .);
    201   PROVIDE (_FIXUP_START_ = .);
    202   .fixup          : { *(.fixup)         } >RAM
    203   PROVIDE (_FIXUP_END_ = .);
    204   PROVIDE (__FIXUP_END__ = .);
    205 
    206   .jcr            : { KEEP (*(.jcr))    } > RAM
    207 
    208   PROVIDE (__GOT_START__ = .);
    209   PROVIDE (_GOT_START_ = .);
    210   s.got = .;
    211   .got            : { *(.got)           } >RAM
    212   .got.plt        : { *(.got.plt)       } >RAM
    213   PROVIDE (_GOT_END_ = .);
    214   PROVIDE (__GOT_END__ = .);
    215 
    216   /* We want the small data sections together, so single-instruction offsets
    217      can access them all, and initialized data all before uninitialized, so
    218      we can shorten the on-disk segment size.  */
    219 _SDA_BASE_ = __SDATA_START__ + 0x8000;
    220   .sdata          : { *(.sdata*) *(.gnu.linkonce.s.*)   } >RAM
    221   _edata  =  .;
    222   PROVIDE (edata = .);
    223 
    224   PROVIDE (RAM_END = 32M);
    225   .sbss      :
    226   {
    227     PROVIDE (__sbss_start = .);
    228     *(.dynsbss)
    229     *(.sbss* .gnu.linkonce.sb.*)
    230     PROVIDE (__sbss_end = .);
    231   } >RAM
    232   PROVIDE (__SBSS_END__ = .);
    233 
    234   .bss       :
    235   {
    236    PROVIDE (__bss_start = .);
    237    *(.dynbss)
    238    *(.bss .bss* .gnu.linkonce.b*)
    239    *(COMMON)
    240   } >RAM
    241   . = ALIGN(16);
    242   . += 0x1000;
    243   PROVIDE(__stack = .);
    244   __rtems_end = . ;
    245   . =  ALIGN(8) + 0x8000;
    246   PROVIDE(_end = .);
    247   PROVIDE(end = .);
    248 
    249   /* These are needed for ELF backends which have not yet been
    250      converted to the new style linker.  */
    251   .stab 0 : { *(.stab) }
    252   .stabstr 0 : { *(.stabstr) }
    253   /* DWARF debug sections.
    254      Symbols in the DWARF debugging sections are relative to the beginning
    255      of the section so we begin them at 0.  */
    256   /* DWARF 1 */
    257   .debug          0 : { *(.debug) }
    258   .line           0 : { *(.line) }
    259   /* GNU DWARF 1 extensions */
    260   .debug_srcinfo  0 : { *(.debug_srcinfo) }
    261   .debug_sfnames  0 : { *(.debug_sfnames) }
    262   /* DWARF 1.1 and DWARF 2 */
    263   .debug_aranges  0 : { *(.debug_aranges) }
    264   .debug_pubnames 0 : { *(.debug_pubnames) }
    265   /* DWARF 2 */
    266   .debug_info     0 : { *(.debug_info) }
    267   .debug_abbrev   0 : { *(.debug_abbrev) }
    268   .debug_line     0 : { *(.debug_line) }
    269   .debug_frame    0 : { *(.debug_frame) }
    270   .debug_str      0 : { *(.debug_str) }
    271   .debug_loc      0 : { *(.debug_loc) }
    272   .debug_macinfo  0 : { *(.debug_macinfo) }
    273   /* SGI/MIPS DWARF 2 extensions */
    274   .debug_weaknames 0 : { *(.debug_weaknames) }
    275   .debug_funcnames 0 : { *(.debug_funcnames) }
    276   .debug_typenames 0 : { *(.debug_typenames) }
    277   .debug_varnames  0 : { *(.debug_varnames) }
    278   /* DWARF 3 */
    279   .debug_pubtypes 0 : { *(.debug_pubtypes .zdebug_pubtypes) }
    280   .debug_ranges   0 : { *(.debug_ranges .zdebug_ranges) }
    281   /* DWARF extension */
    282   .debug_macro    0 : { *(.debug_macro) }
    283   /* These must appear regardless of  .  */
    284 }
     49INCLUDE linkcmds.base
Note: See TracChangeset for help on using the changeset viewer.