X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=ld%2Fscripttempl%2Fnds32elf.sc;h=0f8366d91ac9e0a4c7bd125175c883f44d640832;hb=fd67aa1129fd006ad49ed5ecb2b063705211553a;hp=1609c386b9cbf12e9e0a3b600fa7029bbf9c4f35;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=thirdparty%2Fbinutils-gdb.git diff --git a/ld/scripttempl/nds32elf.sc b/ld/scripttempl/nds32elf.sc index 1609c386b9c..0f8366d91ac 100644 --- a/ld/scripttempl/nds32elf.sc +++ b/ld/scripttempl/nds32elf.sc @@ -1,5 +1,5 @@ -# Copyright (C) 2014-2015 Free Software Foundation, Inc. -# +# Copyright (C) 2014-2024 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. @@ -46,16 +46,16 @@ if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then fi if test -z "$PLT"; then IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }" - PLT=".plt ${RELOCATING-0} : { *(.plt)${IREL_IN_PLT+ *(.iplt)} } + PLT=".plt ${RELOCATING-0} : { *(.plt)${RELOCATING+${IREL_IN_PLT+ *(.iplt)}} } ${IREL_IN_PLT-$IPLT}" fi test -n "${DATA_PLT-${BSS_PLT-text}}" && TEXT_PLT= if test -z "$GOT"; then if test -z "$SEPARATE_GOTPLT"; then - GOT=".got ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) *(.got) *(.igot) }" + GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt) *(.igot.plt)} *(.got)${RELOCATING+ *(.igot)} }" else - GOT=".got ${RELOCATING-0} : { *(.got) *(.igot) }" - GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt) *(.igot.plt) }" + GOT=".got ${RELOCATING-0} : { *(.got)${RELOCATING+ *(.igot)} }" + GOTPLT=".got.plt ${RELOCATING-0} : { *(.got.plt)${RELOCATING+ *(.igot.plt)} }" fi fi REL_IFUNC=".rel.ifunc ${RELOCATING-0} : { *(.rel.ifunc) }" @@ -80,27 +80,27 @@ if test -z "${NO_SMALL_DATA}"; then SBSS=".sbss_b ${RELOCATING-0} : { *(.sbss_b${RELOCATING+ .sbss_b.*}) - *(.scommon_b${RELOCATING+ .scommon_b.*}) + ${RELOCATING+*(.scommon_b .scommon_b.*)} ${RELOCATING+. = ALIGN(2);} } .sbss_h ${RELOCATING-0} : { *(.sbss_h${RELOCATING+ .sbss_h.*}) - *(.scommon_h${RELOCATING+ .scommon_h.*}) + ${RELOCATING+*(.scommon_h .scommon_h.*)} ${RELOCATING+. = ALIGN(4);} } .sbss_w ${RELOCATING-0} : { *(.sbss_w${RELOCATING+ .sbss_w.*}) - *(.scommon_w${RELOCATING+ .scommon_w.*}) + ${RELOCATING+*(.scommon_w .scommon_w.*) *(.dynsbss) *(.scommon) - ${RELOCATING+. = ALIGN(8);} + . = ALIGN(8);} } .sbss_d ${RELOCATING-0} : { *(.sbss_d${RELOCATING+ .sbss_d.*}) - *(.scommon_d${RELOCATING+ .scommon_d.*}) + ${RELOCATING+*(.scommon_d .scommon_d.*)} ${RELOCATING+PROVIDE (__sbss_end = .);} ${RELOCATING+PROVIDE (___sbss_end = .);} }" @@ -246,10 +246,11 @@ DTOR=".dtors ${CONSTRUCTING-0} : KEEP (*(.dtors)) ${CONSTRUCTING+${DTOR_END}} }" -STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : +STACK=".stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} : { ${RELOCATING+${USER_LABEL_PREFIX}_stack = .;} *(.stack) + ${RELOCATING+${STACK_SENTINEL}} }" TEXT_START_ADDR="SEGMENT_START(\"text-segment\", ${TEXT_START_ADDR})" @@ -271,7 +272,7 @@ else fi cat <> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;/__rela_iplt_/d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <> ldscripts/dyntmp.$$ +sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;/__rel_iplt_/d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC >> ldscripts/dyntmp.$$ cat >> ldscripts/dyntmp.$$ <