From 33aa234e0c9062e1879c399616d1b917bcd987c0 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sat, 20 Sep 2008 08:42:53 +0000 Subject: 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'. --- ld/testsuite/lib/ld-lib.exp | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'ld/testsuite/lib') 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] +} -- cgit v1.1