aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/lib/binutils-common.exp
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/testsuite/lib/binutils-common.exp')
-rw-r--r--binutils/testsuite/lib/binutils-common.exp30
1 files changed, 30 insertions, 0 deletions
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 41d94d2..2da7138 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -480,6 +480,36 @@ proc supports_dt_relr {} {
return 0
}
+# Whether a target assembler supports --gsframe.
+proc gas_sframe_check {} {
+ global check_as_sframe_result
+ global AS
+ global ASFLAGS
+ if [info exists check_as_sframe_result] {
+ return $check_as_sframe_result
+ }
+
+ set as_file "tmpdir/check_as_sframe.s"
+ set as_fh [open $as_file w 0666]
+ puts $as_fh "# Generated file. DO NOT EDIT"
+ puts $as_fh "\t.cfi_startproc"
+ puts $as_fh "\t.cfi_endproc"
+ close $as_fh
+ remote_download host $as_file
+ verbose -log "Checking SFrame support in AS:"
+
+ set status [remote_exec host "$AS $ASFLAGS --gsframe $as_file"]
+
+ if { [lindex $status 0] != 0 } then {
+ verbose -log "SFrame not supported in AS"
+ set check_as_sframe_result 0
+ } else {
+ verbose -log "SFrame supported in AS"
+ set check_as_sframe_result 1
+ }
+ return $check_as_sframe_result
+}
+
# get_relative_path FROM TO
#
# Return a relative path to TO starting from FROM, which is usually