X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fscripttempl%2Farmbpabi.sc;h=b910847ccb045aa437be0d413cf0dc7bb66bab64;hb=985743c7fb71a8639186d4f016788d3dc9b9d0da;hp=fb4656fb1132da938eb90a719839ee3c99860ab8;hpb=9f4fb50211b7f57d241f911223874a1d16ae9c1a;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/armbpabi.sc b/ld/scripttempl/armbpabi.sc index fb4656fb11..b910847ccb 100644 --- a/ld/scripttempl/armbpabi.sc +++ b/ld/scripttempl/armbpabi.sc @@ -2,6 +2,12 @@ # OS, where a separate postlinker will operated on the generated # executable or shared object. See elf.sc for configuration variables # that apply; only BPABI-specific variables will be noted here. +# +# Copyright (C) 2014 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. test -z "$ENTRY" && ENTRY=_start test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} @@ -29,8 +35,8 @@ fi INTERP=".interp 0 : { *(.interp) }" PLT=".plt ${RELOCATING-0} : { *(.plt) }" RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }" -DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }" -STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }" +DATARELRO=".data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro .data.rel.ro.*) }" +DISCARDED="/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }" if test -z "${NO_SMALL_DATA}"; then SBSS=".sbss ${RELOCATING-0} : { @@ -64,6 +70,24 @@ else NO_SMALL_DATA=" " fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " +INIT_ARRAY=".init_array ${RELOCATING-0} : + { + /* SymbianOS uses this symbol. */ + ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Base = .);} + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_start = .);}} + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__init_array_end = .);}} + /* SymbianOS uses this symbol. */ + ${RELOCATING+PROVIDE (SHT\$\$INIT_ARRAY\$\$Limit = .);} + }" +FINI_ARRAY=".fini_array ${RELOCATING-0} : + { + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_start = .);}} + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array)) + ${RELOCATING+${CREATE_SHLIB-PROVIDE_HIDDEN (__fini_array_end = .);}} + }" CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${CTOR_START}} @@ -77,14 +101,15 @@ CTOR=".ctors ${CONSTRUCTING-0} : doesn't matter which directory crtbegin.o is in. */ - KEEP (*crtbegin*.o(.ctors)) + KEEP (*crtbegin.o(.ctors)) + KEEP (*crtbegin?.o(.ctors)) /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. + the crtend.o file until after the sorted ctors. The .ctor section from the crtend file contains the end of ctors marker and it must be last */ - KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors)) KEEP (*(SORT(.ctors.*))) KEEP (*(.ctors)) ${CONSTRUCTING+${CTOR_END}} @@ -92,8 +117,9 @@ CTOR=".ctors ${CONSTRUCTING-0} : DTOR=".dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+${DTOR_START}} - KEEP (*crtbegin*.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors)) + KEEP (*crtbegin.o(.dtors)) + KEEP (*crtbegin?.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors)) KEEP (*(SORT(.dtors.*))) KEEP (*(.dtors)) ${CONSTRUCTING+${DTOR_END}} @@ -109,7 +135,7 @@ SHLIB_TEXT_START_ADDR="SEGMENT_START(\"text\", ${SHLIB_TEXT_START_ADDR:-0})" DATA_ADDR="SEGMENT_START(\"data\", ${DATA_ADDR-${DATA_SEGMENT_ALIGN}})" SHLIB_DATA_ADDR="SEGMENT_START(\"data\", ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}})" -# if this is for an embedded system, don't add SIZEOF_HEADERS. +# If this is for an embedded system, don't add SIZEOF_HEADERS. if [ -z "$EMBEDDED" ]; then test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS" SHLIB_BASE_ADDRESS="${SHLIB_TEXT_START_ADDR} + SIZEOF_HEADERS" @@ -119,10 +145,16 @@ else fi cat <