Changeset 5d81ce9 in rtems


Ignore:
Timestamp:
Nov 18, 2002, 12:52:17 AM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
9eadce0
Parents:
69efcbc1
Message:

2002-11-14 Greg Menke <gregory.menke@…>

  • bsp_specs: Added crtbegin,crtend objects so C++ global objects constructors/destructors run correctly.
  • startup/linkcmds: Increased code length and updated the ctor/dtor sections to handle crtbegin, crtend objects.
Location:
c/src/lib/libbsp/powerpc/motorola_powerpc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog

    r69efcbc1 r5d81ce9  
     12002-11-14      Greg Menke <gregory.menke@gsfc.nasa.gov>
     2
     3        * bsp_specs: Added crtbegin,crtend objects so C++ global objects
     4        constructors/destructors run correctly. 
     5        * startup/linkcmds: Increased code length and updated the ctor/dtor
     6        sections to handle crtbegin, crtend objects.
     7>       
    182002-10-21      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    29
  • c/src/lib/libbsp/powerpc/motorola_powerpc/bsp_specs

    r69efcbc1 r5d81ce9  
    1111%{!qrtems: %(old_lib)} %{!nostdlib: %{qrtems: --start-group \
    1212%{!qrtems_debug: -lrtemsbsp -lrtemscpu} %{qrtems_debug: -lrtemsbsp_g -lrtemscpu_g} \
    13 -lc -lgcc --end-group  ecrtn%O%s \
     13-lc -lgcc --end-group  \
    1414%{!qnolinkcmds: -T linkcmds%s}}}
    1515
    1616*startfile:
    17 %{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems:  ecrti%O%s \
     17%{!qrtems: %(old_startfile)} %{!nostdlib: %{qrtems:  ecrti%O%s  crtbegin.o%s  \
    1818%{!qrtems_debug: start.o%s} \
    1919%{qrtems_debug: start_g.o%s}}}
     
    2222%{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -e __rtems_entry_point -u __vectors}
    2323
     24*endfile:
     25%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s ecrtn.o%s}
  • c/src/lib/libbsp/powerpc/motorola_powerpc/startup/linkcmds

    r69efcbc1 r5d81ce9  
    88MEMORY {
    99        VECTORS : ORIGIN = 0x0 ,  LENGTH = 0x3000
    10         CODE : ORIGIN = 0x3000 , LENGTH = 0x100000
     10        CODE : ORIGIN = 0x3000 , LENGTH = 0x200000
    1111}
    1212SECTIONS
     
    6060    *(.gnu.linkonce.t*)
    6161  }  > CODE
    62   .init           : { _init = .; *(.init)       } >CODE
    63   .fini           : { _fini = .; *(.fini)       } >CODE
     62  .init           : { _init = .; KEEP(*(.init)) } >CODE
     63  .fini           : { _fini = .; KEEP(*(.fini)) } >CODE
    6464  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) } > CODE
    6565  .rodata1        : { *(.rodata1) }     > CODE
     
    6767  _etext = .;
    6868  PROVIDE (etext = .);
     69
     70  /* Adjust the address for the data segment.  We want to adjust up to
     71     the same address within the page on the next page up.  */
     72  . = ALIGN(0x10000) + (. & (0x10000 - 1));
     73  /* Ensure the __preinit_array_start label is properly aligned.  We
     74     could instead move the label definition inside the section, but
     75     the linker would then create the section even if it turns out to
     76     be empty, which isn't pretty.  */
     77  . = ALIGN(32 / 8);
     78  PROVIDE (__preinit_array_start = .);
     79  .preinit_array     : { *(.preinit_array) } >CODE
     80  PROVIDE (__preinit_array_end = .);
     81  PROVIDE (__init_array_start = .);
     82  .init_array     : { *(.init_array) } >CODE
     83  PROVIDE (__init_array_end = .);
     84  PROVIDE (__fini_array_start = .);
     85  .fini_array     : { *(.fini_array) } >CODE
     86  PROVIDE (__fini_array_end = .);
     87
    6988  .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >CODE
    7089  .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >CODE
     
    88107    *(.data)
    89108    *(.gnu.linkonce.d*)
    90     CONSTRUCTORS
     109    SORT(CONSTRUCTORS)
    91110  } > CODE
    92111  .data1   : { *(.data1) }      > CODE
     
    101120                PROVIDE (_GOT2_START_ = .);
    102121  .got2           :  { *(.got2) }       > CODE
     122
     123
     124/* removed 11/14, gregm
    103125                PROVIDE (__CTOR_LIST__ = .);
    104126  .ctors          : { *(.ctors) }       > CODE
     
    107129  .dtors          : { *(.dtors) }       > CODE
    108130                PROVIDE (__DTOR_END__ = .);
     131*/
     132
     133
     134  .ctors          :
     135  {
     136    /* gcc uses crtbegin.o to find the start of
     137       the constructors, so we make sure it is
     138       first.  Because this is a wildcard, it
     139       doesn't matter if the user does not
     140       actually link against crtbegin.o; the
     141       linker won't look for a file to match a
     142       wildcard.  The wildcard also means that it
     143       doesn't matter which directory crtbegin.o
     144       is in.  */
     145    KEEP (*crtbegin.o(.ctors))
     146    /* We don't want to include the .ctor section from
     147       from the crtend.o file until after the sorted ctors.
     148       The .ctor section from the crtend file contains the
     149       end of ctors marker and it must be last */
     150    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
     151    KEEP (*(SORT(.ctors.*)))
     152    KEEP (*(.ctors))
     153  } > CODE
     154  .dtors          :
     155  {
     156    KEEP (*crtbegin.o(.dtors))
     157    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
     158    KEEP (*(SORT(.dtors.*)))
     159    KEEP (*(.dtors))
     160  } > CODE
     161
     162
    109163                PROVIDE (_FIXUP_START_ = .);
    110164  .fixup          : { *(.fixup) }       > CODE
     
    112166                PROVIDE (_GOT2_END_ = .);
    113167                PROVIDE (_GOT_START_ = .);
     168
    114169  .got            : { *(.got) } > CODE
    115170  .got.plt        : { *(.got.plt) }     > CODE
     171
    116172                PROVIDE (_GOT_END_ = .);
     173
     174  .jcr            : { KEEP (*(.jcr)) } > CODE
     175
    117176  /* We want the small data sections together, so single-instruction offsets
    118177     can access them all, and initialized data all before uninitialized, so
Note: See TracChangeset for help on using the changeset viewer.