-# Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
return -1
}
+if { [have_fuse_ld_gold] == 0} {
+ return -1
+}
+
standard_testfile
-if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {additional_flags=-fsplit-stack}] } {
+# -fuse-ld=gold is used for calling printf code built without -fsplit-stack
+# which could crash otherwise. See GCC documentation of -fsplit-stack.
+set opts "additional_flags=-fsplit-stack"
+if { [prepare_for_testing "failed to prepare" ${testfile} $srcfile \
+ [list $opts additional_flags=-fuse-ld=gold]] } {
return -1
}