X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ld%2Fscripttempl%2Farmbpabi.sc;h=bc50149c96e99d458a6a458dd839a80f6769c569;hb=1d934d768573dc3e54f32d21f13e962718fcd47f;hp=c8d1bd4ba595f408d2aee9b0f918d402c188e573;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/armbpabi.sc b/ld/scripttempl/armbpabi.sc index c8d1bd4ba5..bc50149c96 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-2020 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,16 +35,16 @@ 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} : { ${RELOCATING+PROVIDE (__sbss_start = .);} ${RELOCATING+PROVIDE (___sbss_start = .);} - *(.dynsbss) + ${RELOCATING+*(.dynsbss)} *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*}) - *(.scommon) + ${RELOCATING+*(.scommon)} ${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);} }" @@ -46,7 +52,7 @@ if test -z "${NO_SMALL_DATA}"; then SDATA="/* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata ${RELOCATING-0} : + .sdata ${RELOCATING-0} : { ${RELOCATING+${SDATA_START_SYMBOLS}} *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*}) @@ -64,7 +70,25 @@ else NO_SMALL_DATA=" " fi test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" " -CTOR=".ctors ${CONSTRUCTING-0} : +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}} /* gcc uses crtbegin.o to find the start of @@ -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 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,42 +145,50 @@ else fi cat <