Changeset 25c3208a in rtems


Ignore:
Timestamp:
Apr 22, 2014, 6:08:14 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
1450de0
Parents:
851e643
git-author:
Joel Sherrill <joel.sherrill@…> (04/22/14 18:08:14)
git-committer:
Joel Sherrill <joel.sherrill@…> (04/22/14 20:12:11)
Message:

gensh4: Correct linking for C++

Location:
c/src/lib/libbsp/sh/gensh4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sh/gensh4/bsp_specs

    r851e643 r25c3208a  
    55*startfile:
    66%{!qrtems: %(old_startfile)} \
    7 %{!nostdlib: %{qrtems: start.o%s -e _start}}
     7%{!nostdlib: %{qrtems: start.o%s crti.o%s crtbegin.o%s -e _start}}
    88
    99*link:
    10 %(old_link) %{qrtems: -dc -dp -N}
     10%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N}
    1111
     12*endfile:
     13%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s}
  • c/src/lib/libbsp/sh/gensh4/startup/linkcmds

    r851e643 r25c3208a  
    4141{
    4242  /* Read-only sections, merged into text segment: */
    43   .init          :
    44   {
    45     KEEP (*(.init))
    46   } =0
    4743  .text      :
    4844  {
     
    8480  _etext = .;
    8581  PROVIDE (etext = .);
    86   .fini      :
    87   {
    88     KEEP (*(.fini))
    89   } =0
     82  .init    .  : { KEEP(*(.init))    } > ram =0
     83  .fini    .  : { KEEP(*(.fini))    } > ram =0
     84  .ctors   .  : { KEEP(*(.ctors))    } > ram =0
     85  .dtors   .  : { KEEP(*(.dtors))    } > ram =0
    9086  .rodata   :
    9187  {
     
    110106  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
    111107  __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
    112   .ctors   :
    113   {
    114     ___ctors = .;
    115     /* gcc uses crtbegin.o to find the start of
    116        the constructors, so we make sure it is
    117        first.  Because this is a wildcard, it
    118        doesn't matter if the user does not
    119        actually link against crtbegin.o; the
    120        linker won't look for a file to match a
    121        wildcard.  The wildcard also means that it
    122        doesn't matter which directory crtbegin.o
    123        is in.  */
    124     KEEP (*crtbegin.o(.ctors))
    125     /* We don't want to include the .ctor section from
    126        from the crtend.o file until after the sorted ctors.
    127        The .ctor section from the crtend file contains the
    128        end of ctors marker and it must be last */
    129     KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
    130     KEEP (*(SORT(.ctors.*)))
    131     KEEP (*(.ctors))
    132     ___ctors_end = .;
    133   } > ram
    134    .dtors         :
    135   {
    136     ___dtors = .;
    137     KEEP (*crtbegin.o(.dtors))
    138     KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
    139     KEEP (*(SORT(.dtors.*)))
    140     KEEP (*(.dtors))
    141     ___dtors_end = .;
    142     copy_start_in_rom = .;
    143   } > ram
    144108
    145109  /* Adjust the address for the data segment.  We want to adjust up to
Note: See TracChangeset for help on using the changeset viewer.