Changeset 511ef83c in rtems for bsps/arm


Ignore:
Timestamp:
Oct 9, 2018, 9:59:48 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6dc0b5f
Parents:
acb53d5
git-author:
Sebastian Huber <sebastian.huber@…> (10/09/18 09:59:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/09/18 10:01:27)
Message:

bsps/arm: Fix ctor/dtor invocation order

Remove obsolete .ctor and .dtor output sections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/arm/shared/start/linkcmds.base

    racb53d5 r511ef83c  
    136136        .init_array : ALIGN_WITH_INPUT {
    137137                PROVIDE_HIDDEN (__init_array_start = .);
    138                 KEEP (*(SORT(.init_array.*)))
    139                 KEEP (*(.init_array))
     138                KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
     139                KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
    140140                PROVIDE_HIDDEN (__init_array_end = .);
    141141        } > REGION_RODATA AT > REGION_RODATA_LOAD
    142142        .fini_array : ALIGN_WITH_INPUT {
    143143                PROVIDE_HIDDEN (__fini_array_start = .);
    144                 KEEP (*(.fini_array))
    145                 KEEP (*(SORT(.fini_array.*)))
     144                KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
     145                KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
    146146                PROVIDE_HIDDEN (__fini_array_end = .);
    147         } > REGION_RODATA AT > REGION_RODATA_LOAD
    148         .ctors : ALIGN_WITH_INPUT {
    149                 /* gcc uses crtbegin.o to find the start of
    150                    the constructors, so we make sure it is
    151                    first.  Because this is a wildcard, it
    152                    doesn't matter if the user does not
    153                    actually link against crtbegin.o; the
    154                    linker won't look for a file to match a
    155                    wildcard.  The wildcard also means that it
    156                    doesn't matter which directory crtbegin.o
    157                    is in.  */
    158                 KEEP (*crtbegin.o(.ctors))
    159                 KEEP (*crtbegin?.o(.ctors))
    160                 /* We don't want to include the .ctor section from
    161                    the crtend.o file until after the sorted ctors.
    162                    The .ctor section from the crtend file contains the
    163                    end of ctors marker and it must be last */
    164                 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
    165                 KEEP (*(SORT(.ctors.*)))
    166                 KEEP (*(.ctors))
    167         } > REGION_RODATA AT > REGION_RODATA_LOAD
    168         .dtors : ALIGN_WITH_INPUT {
    169                 KEEP (*crtbegin.o(.dtors))
    170                 KEEP (*crtbegin?.o(.dtors))
    171                 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
    172                 KEEP (*(SORT(.dtors.*)))
    173                 KEEP (*(.dtors))
    174147        } > REGION_RODATA AT > REGION_RODATA_LOAD
    175148        .data.rel.ro : ALIGN_WITH_INPUT {
Note: See TracChangeset for help on using the changeset viewer.