summaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-03-16 17:10:07 +1030
committerAlan Modra <amodra@gmail.com>2023-03-16 17:30:28 +1030
commit6752dd75f76457902729a5f03d09fa28ec5d68c3 (patch)
treece27cbdcc9d0cabe75983869af5822018d30fd7d /ld
parent3e8b13bf7745cde3a0bb027041df7cad4b29b510 (diff)
downloadbinutils-gdb-6752dd75f76457902729a5f03d09fa28ec5d68c3.tar.gz
Re: Add --enable-linker-verssion
Output sections without any input sections to initialise their flags have their flags initialised by data statements to LOAD, ALLOC, HAS_CONTENTS by default. This is wrong for .comment. Fix that by making the script initialise the section type to INFO, one of the noalloc section types. That also allows the address of .comment to be set to zero, as is usual for non-alloc sections. Also, use source_sh for all of the sourced scripts to set up make dependencies. PR 30187 * scripttempl/misc-sections.sc: Set .comment address to zero and type to INFO. * scripttempl/ft32.sc: Fix breakages from last edit. * scripttempl/arclinux.sc: Use source_sh to source DWARF.sc and misc-sections.sc. * scripttempl/avr.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf64bpf.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfm9s12z.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/pru.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * testsuite/ld-scripts/ld-version-2.d: Don't skip ft32 or pru.
Diffstat (limited to 'ld')
-rw-r--r--ld/scripttempl/arclinux.sc5
-rw-r--r--ld/scripttempl/avr.sc4
-rw-r--r--ld/scripttempl/dlx.sc5
-rw-r--r--ld/scripttempl/elf.sc5
-rw-r--r--ld/scripttempl/elf32cr16.sc4
-rw-r--r--ld/scripttempl/elf32crx.sc4
-rw-r--r--ld/scripttempl/elf32msp430.sc4
-rw-r--r--ld/scripttempl/elf64bpf.sc2
-rw-r--r--ld/scripttempl/elf64hppa.sc4
-rw-r--r--ld/scripttempl/elf_chaos.sc4
-rw-r--r--ld/scripttempl/elfarc.sc4
-rw-r--r--ld/scripttempl/elfarcv2.sc4
-rw-r--r--ld/scripttempl/elfd10v.sc4
-rw-r--r--ld/scripttempl/elfd30v.sc4
-rw-r--r--ld/scripttempl/elfm68hc11.sc4
-rw-r--r--ld/scripttempl/elfm68hc12.sc4
-rw-r--r--ld/scripttempl/elfm9s12z.sc4
-rw-r--r--ld/scripttempl/elfmicroblaze.sc4
-rw-r--r--ld/scripttempl/elfxgate.sc4
-rw-r--r--ld/scripttempl/elfxtensa.sc5
-rw-r--r--ld/scripttempl/epiphany_4x4.sc5
-rw-r--r--ld/scripttempl/ft32.sc13
-rw-r--r--ld/scripttempl/i386beos.sc2
-rw-r--r--ld/scripttempl/i386go32.sc2
-rw-r--r--ld/scripttempl/ia64vms.sc2
-rw-r--r--ld/scripttempl/ip2k.sc5
-rw-r--r--ld/scripttempl/iq2000.sc5
-rw-r--r--ld/scripttempl/mep.sc5
-rw-r--r--ld/scripttempl/misc-sections.sc2
-rw-r--r--ld/scripttempl/mmo.sc2
-rw-r--r--ld/scripttempl/nds32elf.sc5
-rw-r--r--ld/scripttempl/pru.sc5
-rw-r--r--ld/scripttempl/v850.sc5
-rw-r--r--ld/scripttempl/v850_rh850.sc5
-rw-r--r--ld/scripttempl/visium.sc2
-rw-r--r--ld/scripttempl/xstormy16.sc5
-rw-r--r--ld/scripttempl/z80.sc4
-rw-r--r--ld/testsuite/ld-scripts/ld-version-2.d1
38 files changed, 70 insertions, 87 deletions
diff --git a/ld/scripttempl/arclinux.sc b/ld/scripttempl/arclinux.sc
index 9c24e5bc12c..20429df45a8 100644
--- a/ld/scripttempl/arclinux.sc
+++ b/ld/scripttempl/arclinux.sc
@@ -656,9 +656,8 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
index 3677e07eeb9..61cccfccde8 100644
--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -328,13 +328,13 @@ cat <<EOF
EOF
fi
-. $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
.note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) }
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/dlx.sc b/ld/scripttempl/dlx.sc
index f5673f4c05b..8d7a9d53dab 100644
--- a/ld/scripttempl/dlx.sc
+++ b/ld/scripttempl/dlx.sc
@@ -41,9 +41,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
index 92f100b4623..1e3c5aa8504 100644
--- a/ld/scripttempl/elf.sc
+++ b/ld/scripttempl/elf.sc
@@ -722,9 +722,8 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/elf32cr16.sc b/ld/scripttempl/elf32cr16.sc
index aedc17bd430..cefae424656 100644
--- a/ld/scripttempl/elf32cr16.sc
+++ b/ld/scripttempl/elf32cr16.sc
@@ -171,8 +171,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elf32crx.sc b/ld/scripttempl/elf32crx.sc
index 747bfbb1cad..594eaa1f4fb 100644
--- a/ld/scripttempl/elf32crx.sc
+++ b/ld/scripttempl/elf32crx.sc
@@ -169,8 +169,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elf32msp430.sc b/ld/scripttempl/elf32msp430.sc
index 4b0ac8d7e93..6edc908a2a0 100644
--- a/ld/scripttempl/elf32msp430.sc
+++ b/ld/scripttempl/elf32msp430.sc
@@ -332,8 +332,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
test -n "${RELOCATING}" && cat <<EOF
.MSP430.attributes 0 :
diff --git a/ld/scripttempl/elf64bpf.sc b/ld/scripttempl/elf64bpf.sc
index 8ff588bc1fb..74154585125 100644
--- a/ld/scripttempl/elf64bpf.sc
+++ b/ld/scripttempl/elf64bpf.sc
@@ -679,7 +679,7 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
-. $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/elf64hppa.sc b/ld/scripttempl/elf64hppa.sc
index e80d2483630..e85dd397993 100644
--- a/ld/scripttempl/elf64hppa.sc
+++ b/ld/scripttempl/elf64hppa.sc
@@ -533,8 +533,8 @@ if test -n "${NON_ALLOC_DYN}"; then
rm -f ldscripts/dyntmp.$$
fi
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/elf_chaos.sc b/ld/scripttempl/elf_chaos.sc
index f3b2776ef57..72f91c9c9fc 100644
--- a/ld/scripttempl/elf_chaos.sc
+++ b/ld/scripttempl/elf_chaos.sc
@@ -327,8 +327,8 @@ cat <<EOF
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/elfarc.sc b/ld/scripttempl/elfarc.sc
index ccba4a1113d..57cd0a561a0 100644
--- a/ld/scripttempl/elfarc.sc
+++ b/ld/scripttempl/elfarc.sc
@@ -409,8 +409,8 @@ test -n "${RELOCATING}" && cat <<EOF
}
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* ARC Extension Sections */
diff --git a/ld/scripttempl/elfarcv2.sc b/ld/scripttempl/elfarcv2.sc
index 5b547c15a9f..f1b8a69d090 100644
--- a/ld/scripttempl/elfarcv2.sc
+++ b/ld/scripttempl/elfarcv2.sc
@@ -294,8 +294,8 @@ SECTIONS
.note.gnu.build-id : { *(.note.gnu.build-id) }
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* ARC Extension Sections */
diff --git a/ld/scripttempl/elfd10v.sc b/ld/scripttempl/elfd10v.sc
index c08192c9288..e52aaedeac0 100644
--- a/ld/scripttempl/elfd10v.sc
+++ b/ld/scripttempl/elfd10v.sc
@@ -174,8 +174,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elfd30v.sc b/ld/scripttempl/elfd30v.sc
index 2c95f5c16ec..97fafb30764 100644
--- a/ld/scripttempl/elfd30v.sc
+++ b/ld/scripttempl/elfd30v.sc
@@ -199,8 +199,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}
diff --git a/ld/scripttempl/elfm68hc11.sc b/ld/scripttempl/elfm68hc11.sc
index e796a5f7ca0..ea4321ceeb0 100644
--- a/ld/scripttempl/elfm68hc11.sc
+++ b/ld/scripttempl/elfm68hc11.sc
@@ -430,8 +430,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elfm68hc12.sc b/ld/scripttempl/elfm68hc12.sc
index 6fa708977fa..a5a623b5f06 100644
--- a/ld/scripttempl/elfm68hc12.sc
+++ b/ld/scripttempl/elfm68hc12.sc
@@ -432,7 +432,7 @@ SECTIONS
${RELOCATING+${VECTORS}}
EOF
-. $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
/* Treatment of DWARF debug section must be at end of the linker
@@ -441,7 +441,7 @@ cat <<EOF
symbols are found. */
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elfm9s12z.sc b/ld/scripttempl/elfm9s12z.sc
index d77e2130a98..c09b3f7d7a3 100644
--- a/ld/scripttempl/elfm9s12z.sc
+++ b/ld/scripttempl/elfm9s12z.sc
@@ -422,7 +422,7 @@ SECTIONS
${RELOCATING+${VECTORS}}
EOF
-. $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
/* Treatment of DWARF debug section must be at end of the linker
@@ -431,7 +431,7 @@ cat <<EOF
symbols are found. */
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elfmicroblaze.sc b/ld/scripttempl/elfmicroblaze.sc
index 6c17172bf50..5121c5df3a7 100644
--- a/ld/scripttempl/elfmicroblaze.sc
+++ b/ld/scripttempl/elfmicroblaze.sc
@@ -234,8 +234,8 @@ SECTIONS
}
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elfxgate.sc b/ld/scripttempl/elfxgate.sc
index f810788929e..2655e8924f7 100644
--- a/ld/scripttempl/elfxgate.sc
+++ b/ld/scripttempl/elfxgate.sc
@@ -432,8 +432,8 @@ SECTIONS
${RELOCATING+${VECTORS}}
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/elfxtensa.sc b/ld/scripttempl/elfxtensa.sc
index a6cd174ccd0..7c71525cbeb 100644
--- a/ld/scripttempl/elfxtensa.sc
+++ b/ld/scripttempl/elfxtensa.sc
@@ -543,9 +543,8 @@ if test -n "${NON_ALLOC_DYN}"; then
rm -f ldscripts/dyntmp.$$
fi
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/epiphany_4x4.sc b/ld/scripttempl/epiphany_4x4.sc
index 42e2f7e7613..0f4e74f9e06 100644
--- a/ld/scripttempl/epiphany_4x4.sc
+++ b/ld/scripttempl/epiphany_4x4.sc
@@ -626,9 +626,8 @@ if test -n "${NON_ALLOC_DYN}"; then
rm -f ldscripts/dyntmp.$$
fi
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/ft32.sc b/ld/scripttempl/ft32.sc
index e2d5a6bdfc9..e52e75cd924 100644
--- a/ld/scripttempl/ft32.sc
+++ b/ld/scripttempl/ft32.sc
@@ -60,14 +60,11 @@ SECTIONS
${RELOCATING+ __data_load_start = LOADADDR(.data); }
${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
+EOF
- .stab 0 ${RELOCATING+(NOLOAD)} :
- {
- *(.stab)
- }
- .stabstr 0 ${RELOCATING+(NOLOAD)} :
- {
- *(.stabstr)
- }
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
+
+cat <<EOF
}
EOF
diff --git a/ld/scripttempl/i386beos.sc b/ld/scripttempl/i386beos.sc
index 284fcb38a15..1a2422edc04 100644
--- a/ld/scripttempl/i386beos.sc
+++ b/ld/scripttempl/i386beos.sc
@@ -174,7 +174,7 @@ SECTIONS
}
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/i386go32.sc b/ld/scripttempl/i386go32.sc
index 49959af7025..9459f00492c 100644
--- a/ld/scripttempl/i386go32.sc
+++ b/ld/scripttempl/i386go32.sc
@@ -91,7 +91,7 @@ SECTIONS
.stabstr 0 : { *(.stabstr) }
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/ia64vms.sc b/ld/scripttempl/ia64vms.sc
index da37c39178f..4e0f4c09b12 100644
--- a/ld/scripttempl/ia64vms.sc
+++ b/ld/scripttempl/ia64vms.sc
@@ -122,7 +122,7 @@ SECTIONS
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
.note : { *(.vms.note) }
diff --git a/ld/scripttempl/ip2k.sc b/ld/scripttempl/ip2k.sc
index 89a2f1639e7..0ce66bae418 100644
--- a/ld/scripttempl/ip2k.sc
+++ b/ld/scripttempl/ip2k.sc
@@ -137,9 +137,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/iq2000.sc b/ld/scripttempl/iq2000.sc
index 44228e7f1a8..47bd777327e 100644
--- a/ld/scripttempl/iq2000.sc
+++ b/ld/scripttempl/iq2000.sc
@@ -408,9 +408,8 @@ cat <<EOF
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${RELOCATING+${OTHER_RELOCATING_SECTIONS}}
diff --git a/ld/scripttempl/mep.sc b/ld/scripttempl/mep.sc
index 1a0252d9073..6b80c36066b 100644
--- a/ld/scripttempl/mep.sc
+++ b/ld/scripttempl/mep.sc
@@ -408,9 +408,8 @@ cat <<EOF
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${STACK_ADDR+${STACK}}
diff --git a/ld/scripttempl/misc-sections.sc b/ld/scripttempl/misc-sections.sc
index 115ef1a5579..6de910a64ad 100644
--- a/ld/scripttempl/misc-sections.sc
+++ b/ld/scripttempl/misc-sections.sc
@@ -13,7 +13,7 @@ cat <<EOF
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
- .comment : { *(.comment); LINKER_VERSION; }
+ .comment 0 (INFO) : { *(.comment); LINKER_VERSION; }
.gnu.build.attributes : { *(.gnu.build.attributes${RELOCATING+ .gnu.build.attributes.*}) }
diff --git a/ld/scripttempl/mmo.sc b/ld/scripttempl/mmo.sc
index 823f2585425..746fb1a062b 100644
--- a/ld/scripttempl/mmo.sc
+++ b/ld/scripttempl/mmo.sc
@@ -128,7 +128,7 @@ SECTIONS
.stab.indexstr 0 : { *(.stab.indexstr) }
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
.MMIX.reg_contents :
diff --git a/ld/scripttempl/nds32elf.sc b/ld/scripttempl/nds32elf.sc
index b3acb016780..9645e80c567 100644
--- a/ld/scripttempl/nds32elf.sc
+++ b/ld/scripttempl/nds32elf.sc
@@ -601,9 +601,8 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}
diff --git a/ld/scripttempl/pru.sc b/ld/scripttempl/pru.sc
index a24005b0f66..8531cb8d5be 100644
--- a/ld/scripttempl/pru.sc
+++ b/ld/scripttempl/pru.sc
@@ -204,9 +204,8 @@ SECTIONS
.note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) }
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/v850.sc b/ld/scripttempl/v850.sc
index 515aeb149a9..3de6bdd2ef5 100644
--- a/ld/scripttempl/v850.sc
+++ b/ld/scripttempl/v850.sc
@@ -198,9 +198,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* User stack. */
diff --git a/ld/scripttempl/v850_rh850.sc b/ld/scripttempl/v850_rh850.sc
index a06889354ad..2c70914c119 100644
--- a/ld/scripttempl/v850_rh850.sc
+++ b/ld/scripttempl/v850_rh850.sc
@@ -218,9 +218,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* User stack. */
diff --git a/ld/scripttempl/visium.sc b/ld/scripttempl/visium.sc
index def19ca84bb..d11dafd7157 100644
--- a/ld/scripttempl/visium.sc
+++ b/ld/scripttempl/visium.sc
@@ -167,7 +167,7 @@ SECTIONS
EOF
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/scripttempl/xstormy16.sc b/ld/scripttempl/xstormy16.sc
index 2b3c0519619..ccae0a2e04f 100644
--- a/ld/scripttempl/xstormy16.sc
+++ b/ld/scripttempl/xstormy16.sc
@@ -205,9 +205,8 @@ SECTIONS
EOF
-. $srcdir/scripttempl/misc-sections.sc
-
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${RELOCATING+${OTHER_RELOCATING_SECTIONS}}
diff --git a/ld/scripttempl/z80.sc b/ld/scripttempl/z80.sc
index 75a6a4a7972..1ea8bee32ac 100644
--- a/ld/scripttempl/z80.sc
+++ b/ld/scripttempl/z80.sc
@@ -51,8 +51,8 @@ SECTIONS
}
EOF
-. $srcdir/scripttempl/misc-sections.sc
-. $srcdir/scripttempl/DWARF.sc
+source_sh $srcdir/scripttempl/misc-sections.sc
+source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
diff --git a/ld/testsuite/ld-scripts/ld-version-2.d b/ld/testsuite/ld-scripts/ld-version-2.d
index 761234901ff..c8738fd82d6 100644
--- a/ld/testsuite/ld-scripts/ld-version-2.d
+++ b/ld/testsuite/ld-scripts/ld-version-2.d
@@ -2,7 +2,6 @@
# ld: --enable-linker-version -e 0
# readelf: -p.comment
# target: [is_elf_format]
-# skip: ft32-*-* pru-*-*
String dump of section '.comment':
.*GNU ld \(GNU Binutils\) 2.*