aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/lib
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2008-09-20 08:42:53 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2008-09-20 08:42:53 +0000
commit33aa234e0c9062e1879c399616d1b917bcd987c0 (patch)
tree72ecaff675027b2f1374fcc5442a05d6a5c94a4f /ld/testsuite/lib
parentd5026a7d6d87c92e0713578f32ca8c9ed7063100 (diff)
downloadgdb-33aa234e0c9062e1879c399616d1b917bcd987c0.zip
gdb-33aa234e0c9062e1879c399616d1b917bcd987c0.tar.gz
gdb-33aa234e0c9062e1879c399616d1b917bcd987c0.tar.bz2
Provide virtual target "cfi" for targets supporting CFI.
* ld-elf/eh-frame-hdr.d: Replace target and xfail statements by single `target: cfi'. * ld-elf/eh-group.exp: Call check_as_cfi instead of is_elf_format. * ld-elf/eh-group1.s, elf/eh-group2.s: Use more compatible section flags prefix '%'. * ld-elf/eh5.d: Replace target statement by `target: cfi' with an Alpha exception. Relax the `Code alignment factor' matching. * lib/ld-lib.exp: Rename istarget as istarget_ld. (istarget, check_as_cfi): New procedure. (run_dump_test): New comment for the virtual target `cfi'.
Diffstat (limited to 'ld/testsuite/lib')
-rw-r--r--ld/testsuite/lib/ld-lib.exp39
1 files changed, 38 insertions, 1 deletions
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 1ebb1a2..d4e996e 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -598,7 +598,8 @@ proc simple_diff { file_1 file_2 } {
#
# target: TARGET
# Only run the test for TARGET. This may occur more than once; the
-# target being tested must match at least one.
+# target being tested must match at least one. You may provide target
+# name "cfi" for any target supporting the CFI statements.
#
# notarget: TARGET
# Do not run the test for TARGET. This may occur more than once;
@@ -1569,3 +1570,39 @@ proc check_gc_sections_available { } {
}
return $gc_sections_available_saved
}
+
+# Check if the assembler supports CFI statements.
+
+proc check_as_cfi { } {
+ global check_as_cfi_result
+ global as
+ if [info exists check_as_cfi_result] {
+ return $check_as_cfi_result
+ }
+ set as_file "tmpdir/check_as_cfi.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 CFI support:"
+ rename "perror" "check_as_cfi_perror"
+ proc perror { args } { }
+ set success [ld_assemble $as $as_file "/dev/null"]
+ rename "perror" ""
+ rename "check_as_cfi_perror" "perror"
+ #remote_file host delete $as_file
+ set check_as_cfi_result $success
+ return $success
+}
+
+# Provide virtual target "cfi" for targets supporting CFI.
+
+rename "istarget" "istarget_ld"
+proc istarget { target } {
+ if {$target == "cfi"} {
+ return [check_as_cfi]
+ }
+ return [istarget_ld $target]
+}