b5b5b81
http://sourceware.org/ml/binutils-cvs/2008-09/msg00089.html
b5b5b81
http://sourceware.org/ml/binutils/2008-09/msg00124.html
b5b5b81
b5b5b81
bfd/
b5b5b81
2008-09-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
b5b5b81
b5b5b81
	PR 6893 - Do not consider FDEs for discarded sections as invalid.
b5b5b81
	* elf-eh-frame.c (_bfd_elf_parse_eh_frame): New REQUIRE_CLEARED_RELOCS.
b5b5b81
	Consider FDEs with cleared relocations as valid and ignorable.
b5b5b81
b5b5b81
binutils/
b5b5b81
2008-09-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
b5b5b81
b5b5b81
	Suppress warnings on NONE relocations to discarded sections.
b5b5b81
	* readelf.c (is_none_reloc): New function.
b5b5b81
	(debug_apply_relocations): Ignore is_none_reloc() relocations.
b5b5b81
b5b5b81
testsuite/
b5b5b81
2008-09-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
b5b5b81
b5b5b81
	* ld-elf/eh-group.exp, ld-elf/eh-group1.s, ld-elf/eh-group2.s: New test.
b5b5b81
b5b5b81
[ binutils/readelf.c patch backported for 2.18.50.0.6.  ]
b5b5b81
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
b5b5b81
retrieving revision 1.72
b5b5b81
retrieving revision 1.73
b5b5b81
diff -u -r1.72 -r1.73
b5b5b81
--- bfd/elf-eh-frame.c	2008/08/24 21:43:00	1.72
b5b5b81
+++ bfd/elf-eh-frame.c	2008/09/17 07:50:28	1.73
b5b5b81
@@ -549,6 +549,16 @@
b5b5b81
 	     < (bfd_size_type) ((buf) - ehbuf)))	\
b5b5b81
     cookie->rel++
b5b5b81
 
b5b5b81
+#define REQUIRE_CLEARED_RELOCS(buf)			\
b5b5b81
+  while (cookie->rel < cookie->relend			\
b5b5b81
+	 && (cookie->rel->r_offset			\
b5b5b81
+	     < (bfd_size_type) ((buf) - ehbuf)))	\
b5b5b81
+    {							\
b5b5b81
+      REQUIRE (cookie->rel->r_info == 0);		\
b5b5b81
+      REQUIRE (cookie->rel->r_addend == 0);		\
b5b5b81
+      cookie->rel++;					\
b5b5b81
+    }
b5b5b81
+
b5b5b81
 #define GET_RELOC(buf)					\
b5b5b81
   ((cookie->rel < cookie->relend			\
b5b5b81
     && (cookie->rel->r_offset				\
b5b5b81
@@ -766,9 +776,14 @@
b5b5b81
 
b5b5b81
 	  /* Chain together the FDEs for each section.  */
b5b5b81
 	  rsec = _bfd_elf_gc_mark_rsec (info, sec, gc_mark_hook, cookie);
b5b5b81
-	  REQUIRE (rsec && rsec->owner == abfd);
b5b5b81
-	  this_inf->u.fde.next_for_section = elf_fde_list (rsec);
b5b5b81
-	  elf_fde_list (rsec) = this_inf;
b5b5b81
+	  /* RSEC will be NULL if FDE was cleared out as it was belonging to
b5b5b81
+	     a discarded SHT_GROUP.  */
b5b5b81
+	  if (rsec)
b5b5b81
+	    {
b5b5b81
+	      REQUIRE (rsec->owner == abfd);
b5b5b81
+	      this_inf->u.fde.next_for_section = elf_fde_list (rsec);
b5b5b81
+	      elf_fde_list (rsec) = this_inf;
b5b5b81
+	    }
b5b5b81
 
b5b5b81
 	  /* Skip the initial location and address range.  */
b5b5b81
 	  start = buf;
b5b5b81
@@ -801,7 +816,17 @@
b5b5b81
 	  insns = buf;
b5b5b81
 
b5b5b81
 	  buf = last_fde + 4 + hdr_length;
b5b5b81
-	  SKIP_RELOCS (buf);
b5b5b81
+
b5b5b81
+	  /* Cleared FDE?  The instructions will not be cleared but verify all
b5b5b81
+	     the relocation entries for them are cleared.  */
b5b5b81
+	  if (rsec == NULL)
b5b5b81
+	    {
b5b5b81
+	      REQUIRE_CLEARED_RELOCS (buf);
b5b5b81
+	    }
b5b5b81
+	  else
b5b5b81
+	    {
b5b5b81
+	      SKIP_RELOCS (buf);
b5b5b81
+	    }
b5b5b81
 	}
b5b5b81
 
b5b5b81
       /* Try to interpret the CFA instructions and find the first
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/binutils/readelf.c,v
b5b5b81
retrieving revision 1.425
b5b5b81
retrieving revision 1.426
b5b5b81
diff -u -r1.425 -r1.426
b5b5b81
--- binutils/readelf.c	2008/09/05 14:49:05	1.425
b5b5b81
+++ binutils/readelf.c	2008/09/17 07:50:28	1.426
b5b5b81
@@ -8271,6 +8271,53 @@ is_16bit_abs_reloc (unsigned int reloc_t
b5b5b81
     }
b5b5b81
 }
b5b5b81
 
b5b5b81
+/* Returns TRUE iff RELOC_TYPE is a NONE relocation used for discarded
b5b5b81
+   relocation entries (possibly formerly used for SHT_GROUP sections).  */
b5b5b81
+
b5b5b81
+static bfd_boolean
b5b5b81
+is_none_reloc (unsigned int reloc_type)
b5b5b81
+{
b5b5b81
+  switch (elf_header.e_machine)
b5b5b81
+    {
b5b5b81
+    case EM_68K:
b5b5b81
+      return reloc_type == 0; /* R_68K_NONE.  */
b5b5b81
+    case EM_386:
b5b5b81
+      return reloc_type == 0; /* R_386_NONE.  */
b5b5b81
+    case EM_SPARC32PLUS:
b5b5b81
+    case EM_SPARCV9:
b5b5b81
+    case EM_SPARC:
b5b5b81
+      return reloc_type == 0; /* R_SPARC_NONE.  */
b5b5b81
+    case EM_MIPS:
b5b5b81
+      return reloc_type == 0; /* R_MIPS_NONE.  */
b5b5b81
+    case EM_PARISC:
b5b5b81
+      return reloc_type == 0; /* R_PARISC_NONE.  */
b5b5b81
+    case EM_ALPHA:
b5b5b81
+      return reloc_type == 0; /* R_ALPHA_NONE.  */
b5b5b81
+    case EM_PPC:
b5b5b81
+      return reloc_type == 0; /* R_PPC_NONE.  */
b5b5b81
+    case EM_PPC64:
b5b5b81
+      return reloc_type == 0; /* R_PPC64_NONE.  */
b5b5b81
+    case EM_ARM:
b5b5b81
+      return reloc_type == 0; /* R_ARM_NONE.  */
b5b5b81
+    case EM_IA_64:
b5b5b81
+      return reloc_type == 0; /* R_IA64_NONE.  */
b5b5b81
+    case EM_SH:
b5b5b81
+      return reloc_type == 0; /* R_SH_NONE.  */
b5b5b81
+    case EM_S390_OLD:
b5b5b81
+    case EM_S390:
b5b5b81
+      return reloc_type == 0; /* R_390_NONE.  */
b5b5b81
+    case EM_CRIS:
b5b5b81
+      return reloc_type == 0; /* R_CRIS_NONE.  */
b5b5b81
+    case EM_X86_64:
b5b5b81
+      return reloc_type == 0; /* R_X86_64_NONE.  */
b5b5b81
+    case EM_MN10300:
b5b5b81
+      return reloc_type == 0; /* R_MN10300_NONE.  */
b5b5b81
+    case EM_M32R:
b5b5b81
+      return reloc_type == 0; /* R_M32R_NONE.  */
b5b5b81
+    }
b5b5b81
+  return FALSE;
b5b5b81
+}
b5b5b81
+
b5b5b81
 /* Apply relocations to a debug section.  */
b5b5b81
 
b5b5b81
 static void
b5b5b81
@@ -8419,6 +8466,9 @@
b5b5b81
 
b5b5b81
 	  reloc_type = get_reloc_type (rp->r_info);
b5b5b81
 
b5b5b81
+	  if (is_none_reloc (reloc_type))
b5b5b81
+	    continue;
b5b5b81
+
b5b5b81
 	  if (is_32bit_abs_reloc (reloc_type)
b5b5b81
 	      || is_32bit_pcrel_reloc (reloc_type))
b5b5b81
 	    reloc_size = 4;
b5b5b81
/cvs/src/src/ld/testsuite/ld-elf/eh-group.exp,v  -->  standard output
b5b5b81
revision 1.1
b5b5b81
--- ld/testsuite/ld-elf/eh-group.exp
b5b5b81
+++ ld/testsuite/ld-elf/eh-group.exp	2008-09-21 22:56:18.321559000 +0000
b5b5b81
@@ -0,0 +1,51 @@
b5b5b81
+# Expect script for .eh_frame entries to a removed section.
b5b5b81
+#   Copyright 2008  Free Software Foundation, Inc.
b5b5b81
+#
b5b5b81
+# This file is part of the GNU Binutils.
b5b5b81
+#
b5b5b81
+# This program is free software; you can redistribute it and/or modify
b5b5b81
+# it under the terms of the GNU General Public License as published by
b5b5b81
+# the Free Software Foundation; either version 3 of the License, or
b5b5b81
+# (at your option) any later version.
b5b5b81
+#
b5b5b81
+# This program is distributed in the hope that it will be useful,
b5b5b81
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
b5b5b81
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b5b5b81
+# GNU General Public License for more details.
b5b5b81
+#
b5b5b81
+# You should have received a copy of the GNU General Public License
b5b5b81
+# along with this program; if not, write to the Free Software
b5b5b81
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
b5b5b81
+# MA 02110-1301, USA.
b5b5b81
+#
b5b5b81
+
b5b5b81
+#
b5b5b81
+# Written by Jan Kratochvil (jan.kratochvil@redhat.com)
b5b5b81
+#
b5b5b81
+# .eh_frame with relocations to a removed (group) section did result to:
b5b5b81
+# error in tmpdir/eh-group.o(.eh_frame); no .eh_frame_hdr table will be created.
b5b5b81
+# The purpose of this test is to merge two .o files with -r and then link this
b5b5b81
+# merged file (containing a discarded R_X86_64_NONE relocation) to the final
b5b5b81
+# executable trying to create .eh_frame_hdr.  It needs a separate .exp file due
b5b5b81
+# to the requirement of two `ld' runs.
b5b5b81
+
b5b5b81
+# Exclude non-ELF targets.
b5b5b81
+
b5b5b81
+if ![is_elf_format] {
b5b5b81
+    return
b5b5b81
+}
b5b5b81
+
b5b5b81
+set build_tests_ld {
b5b5b81
+  {"Build eh-group1.o"
b5b5b81
+   "-r" ""
b5b5b81
+   {eh-group1.s eh-group2.s} {} "eh-group.o"}
b5b5b81
+}
b5b5b81
+
b5b5b81
+run_ld_link_tests $build_tests_ld
b5b5b81
+
b5b5b81
+set testname "Link eh-group.o to eh-group"
b5b5b81
+if [ld_simple_link $ld "tmpdir/eh-group" "-e _start tmpdir/eh-group.o"] {
b5b5b81
+    pass $testname
b5b5b81
+} else {
b5b5b81
+    fail $testname
b5b5b81
+}
b5b5b81
/cvs/src/src/ld/testsuite/ld-elf/eh-group1.s,v  -->  standard output
b5b5b81
revision 1.1
b5b5b81
--- ld/testsuite/ld-elf/eh-group1.s
b5b5b81
+++ ld/testsuite/ld-elf/eh-group1.s	2008-09-21 22:56:19.003793000 +0000
b5b5b81
@@ -0,0 +1,6 @@
b5b5b81
+	.section	sect, "axG", @progbits, sectgroup, comdat
b5b5b81
+	.global	_start
b5b5b81
+_start:
b5b5b81
+	.cfi_startproc
b5b5b81
+	.skip 16
b5b5b81
+	.cfi_endproc
b5b5b81
/cvs/src/src/ld/testsuite/ld-elf/eh-group2.s,v  -->  standard output
b5b5b81
revision 1.1
b5b5b81
--- ld/testsuite/ld-elf/eh-group2.s
b5b5b81
+++ ld/testsuite/ld-elf/eh-group2.s	2008-09-21 22:56:19.663297000 +0000
b5b5b81
@@ -0,0 +1,4 @@
b5b5b81
+	.section	sect, "axG", @progbits, sectgroup, comdat
b5b5b81
+	.cfi_startproc
b5b5b81
+	.skip 16
b5b5b81
+	.cfi_endproc
b5b5b81
b5b5b81
http://sourceware.org/ml/binutils-cvs/2008-09/msg00107.html
b5b5b81
http://sourceware.org/ml/binutils/2008-09/msg00145.html
b5b5b81
b5b5b81
testsuite/
b5b5b81
2008-09-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
b5b5b81
b5b5b81
	Provide virtual target "cfi" for targets supporting CFI.
b5b5b81
	* ld-elf/eh-frame-hdr.d: Replace target and xfail statements by single
b5b5b81
	`target: cfi'.
b5b5b81
	* ld-elf/eh-group.exp: Call check_as_cfi instead of is_elf_format.
b5b5b81
	* ld-elf/eh-group1.s, elf/eh-group2.s: Use more compatible section
b5b5b81
	flags prefix '%'.
b5b5b81
	* ld-elf/eh5.d: Replace target statement by `target: cfi' with an Alpha
b5b5b81
	exception.  Relax the `Code alignment factor' matching.
b5b5b81
	* lib/ld-lib.exp: Rename istarget as istarget_ld.
b5b5b81
	(istarget, check_as_cfi): New procedure.
b5b5b81
	(run_dump_test): New comment for the virtual target `cfi'.
b5b5b81
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/ld/testsuite/ld-elf/eh-frame-hdr.d,v
b5b5b81
retrieving revision 1.1
b5b5b81
retrieving revision 1.2
b5b5b81
diff -u -r1.1 -r1.2
b5b5b81
--- ld/testsuite/ld-elf/eh-frame-hdr.d	2006/12/04 08:57:09	1.1
b5b5b81
+++ ld/testsuite/ld-elf/eh-frame-hdr.d	2008/09/20 08:42:53	1.2
b5b5b81
@@ -1,17 +1,7 @@
b5b5b81
 #source: eh-frame-hdr.s
b5b5b81
 #ld: -e _start --eh-frame-hdr
b5b5b81
 #objdump: -hw
b5b5b81
-#target: alpha*-*-*
b5b5b81
-#target: arm*-*-*
b5b5b81
-#target: i?86-*-*
b5b5b81
-#target: m68k-*-*
b5b5b81
-#target: mips*-*-*
b5b5b81
-#target: powerpc*-*-*
b5b5b81
-#target: s390*-*-*
b5b5b81
-#target: sh*-*-*
b5b5b81
-#xfail: sh*l*-*-*
b5b5b81
-#target: sparc*-*-*
b5b5b81
-#target: x86_64-*-*
b5b5b81
+#target: cfi
b5b5b81
 #...
b5b5b81
   [0-9] .eh_frame_hdr 0*[12][048c] .*
b5b5b81
 #pass
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/ld/testsuite/ld-elf/eh-group.exp,v
b5b5b81
retrieving revision 1.1
b5b5b81
retrieving revision 1.2
b5b5b81
diff -u -r1.1 -r1.2
b5b5b81
--- ld/testsuite/ld-elf/eh-group.exp	2008/09/17 07:50:29	1.1
b5b5b81
+++ ld/testsuite/ld-elf/eh-group.exp	2008/09/20 08:42:53	1.2
b5b5b81
@@ -29,9 +29,9 @@
b5b5b81
 # executable trying to create .eh_frame_hdr.  It needs a separate .exp file due
b5b5b81
 # to the requirement of two `ld' runs.
b5b5b81
 
b5b5b81
-# Exclude non-ELF targets.
b5b5b81
+# Exclude non-CFI (such as ia64) targets.
b5b5b81
 
b5b5b81
-if ![is_elf_format] {
b5b5b81
+if {![check_as_cfi]} {
b5b5b81
     return
b5b5b81
 }
b5b5b81
 
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/ld/testsuite/ld-elf/eh-group1.s,v
b5b5b81
retrieving revision 1.1
b5b5b81
retrieving revision 1.2
b5b5b81
diff -u -r1.1 -r1.2
b5b5b81
--- ld/testsuite/ld-elf/eh-group1.s	2008/09/17 07:50:29	1.1
b5b5b81
+++ ld/testsuite/ld-elf/eh-group1.s	2008/09/20 08:42:53	1.2
b5b5b81
@@ -1,4 +1,4 @@
b5b5b81
-	.section	sect, "axG", @progbits, sectgroup, comdat
b5b5b81
+	.section	sect, "axG", %progbits, sectgroup, comdat
b5b5b81
 	.global	_start
b5b5b81
 _start:
b5b5b81
 	.cfi_startproc
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/ld/testsuite/ld-elf/eh-group2.s,v
b5b5b81
retrieving revision 1.1
b5b5b81
retrieving revision 1.2
b5b5b81
diff -u -r1.1 -r1.2
b5b5b81
--- ld/testsuite/ld-elf/eh-group2.s	2008/09/17 07:50:29	1.1
b5b5b81
+++ ld/testsuite/ld-elf/eh-group2.s	2008/09/20 08:42:53	1.2
b5b5b81
@@ -1,4 +1,4 @@
b5b5b81
-	.section	sect, "axG", @progbits, sectgroup, comdat
b5b5b81
+	.section	sect, "axG", %progbits, sectgroup, comdat
b5b5b81
 	.cfi_startproc
b5b5b81
 	.skip 16
b5b5b81
 	.cfi_endproc
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/ld/testsuite/ld-elf/eh5.d,v
b5b5b81
retrieving revision 1.2
b5b5b81
retrieving revision 1.3
b5b5b81
diff -u -r1.2 -r1.3
b5b5b81
--- ld/testsuite/ld-elf/eh5.d	2008/01/28 15:15:32	1.2
b5b5b81
+++ ld/testsuite/ld-elf/eh5.d	2008/09/20 08:42:53	1.3
b5b5b81
@@ -3,14 +3,15 @@
b5b5b81
 #source: eh5b.s
b5b5b81
 #ld:
b5b5b81
 #readelf: -wf
b5b5b81
-#target: x86_64-*-* i?86-*-*
b5b5b81
+#target: cfi
b5b5b81
+#notarget: alpha*
b5b5b81
 
b5b5b81
 The section .eh_frame contains:
b5b5b81
 
b5b5b81
 00000000 0000001[04] 00000000 CIE
b5b5b81
   Version:               1
b5b5b81
   Augmentation:          "zR"
b5b5b81
-  Code alignment factor: 1
b5b5b81
+  Code alignment factor: .*
b5b5b81
   Data alignment factor: .*
b5b5b81
   Return address column: .*
b5b5b81
   Augmentation data:     1b
b5b5b81
@@ -29,7 +30,7 @@
b5b5b81
 000000(2c|30) 00000014 00000000 CIE
b5b5b81
   Version:               1
b5b5b81
   Augmentation:          "zPR"
b5b5b81
-  Code alignment factor: 1
b5b5b81
+  Code alignment factor: .*
b5b5b81
   Data alignment factor: .*
b5b5b81
   Return address column: .*
b5b5b81
   Augmentation data:     03 .. .. .. .. 1b
b5b5b81
@@ -53,7 +54,7 @@
b5b5b81
 0000007[48] 0000001[8c] 00000000 CIE
b5b5b81
   Version:               1
b5b5b81
   Augmentation:          "zPLR"
b5b5b81
-  Code alignment factor: 1
b5b5b81
+  Code alignment factor: .*
b5b5b81
   Data alignment factor: .*
b5b5b81
   Return address column: .*
b5b5b81
   Augmentation data:     03 .. .. .. .. 0c 1b
b5b5b81
@@ -74,7 +75,7 @@
b5b5b81
 000000b[08] 0000001[04] 00000000 CIE
b5b5b81
   Version:               1
b5b5b81
   Augmentation:          "zR"
b5b5b81
-  Code alignment factor: 1
b5b5b81
+  Code alignment factor: .*
b5b5b81
   Data alignment factor: .*
b5b5b81
   Return address column: .*
b5b5b81
   Augmentation data:     1b
b5b5b81
@@ -89,7 +90,7 @@
b5b5b81
 000000[de]8 00000014 00000000 CIE
b5b5b81
   Version:               1
b5b5b81
   Augmentation:          "zPR"
b5b5b81
-  Code alignment factor: 1
b5b5b81
+  Code alignment factor: .*
b5b5b81
   Data alignment factor: .*
b5b5b81
   Return address column: .*
b5b5b81
   Augmentation data:     03 .. .. .. .. 1b
b5b5b81
@@ -111,7 +112,7 @@
b5b5b81
 000001(1c|30) 0000001[8c] 00000000 CIE
b5b5b81
   Version:               1
b5b5b81
   Augmentation:          "zPLR"
b5b5b81
-  Code alignment factor: 1
b5b5b81
+  Code alignment factor: .*
b5b5b81
   Data alignment factor: .*
b5b5b81
   Return address column: .*
b5b5b81
   Augmentation data:     03 .. .. .. .. 0c 1b
b5b5b81
===================================================================
b5b5b81
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
b5b5b81
retrieving revision 1.54
b5b5b81
retrieving revision 1.55
b5b5b81
diff -u -r1.54 -r1.55
b5b5b81
--- ld/testsuite/lib/ld-lib.exp	2008/02/18 11:04:09	1.54
b5b5b81
+++ ld/testsuite/lib/ld-lib.exp	2008/09/20 08:42:53	1.55
b5b5b81
@@ -598,7 +598,8 @@
b5b5b81
 #
b5b5b81
 #   target: TARGET
b5b5b81
 #       Only run the test for TARGET.  This may occur more than once; the
b5b5b81
-#       target being tested must match at least one.
b5b5b81
+#       target being tested must match at least one.  You may provide target
b5b5b81
+#       name "cfi" for any target supporting the CFI statements.
b5b5b81
 #
b5b5b81
 #   notarget: TARGET
b5b5b81
 #       Do not run the test for TARGET.  This may occur more than once;
b5b5b81
@@ -1569,3 +1570,39 @@
b5b5b81
     }
b5b5b81
     return $gc_sections_available_saved
b5b5b81
 }
b5b5b81
+
b5b5b81
+# Check if the assembler supports CFI statements.
b5b5b81
+
b5b5b81
+proc check_as_cfi { } {
b5b5b81
+    global check_as_cfi_result
b5b5b81
+    global as
b5b5b81
+    if [info exists check_as_cfi_result] {
b5b5b81
+	return $check_as_cfi_result
b5b5b81
+    }
b5b5b81
+    set as_file "tmpdir/check_as_cfi.s"
b5b5b81
+    set as_fh [open $as_file w 0666]
b5b5b81
+    puts $as_fh "# Generated file. DO NOT EDIT"
b5b5b81
+    puts $as_fh "\t.cfi_startproc"
b5b5b81
+    puts $as_fh "\t.cfi_endproc"
b5b5b81
+    close $as_fh
b5b5b81
+    remote_download host $as_file
b5b5b81
+    verbose -log "Checking CFI support:"
b5b5b81
+    rename "perror" "check_as_cfi_perror"
b5b5b81
+    proc perror { args } { }
b5b5b81
+    set success [ld_assemble $as $as_file "/dev/null"]
b5b5b81
+    rename "perror" ""
b5b5b81
+    rename "check_as_cfi_perror" "perror"
b5b5b81
+    #remote_file host delete $as_file
b5b5b81
+    set check_as_cfi_result $success
b5b5b81
+    return $success
b5b5b81
+}
b5b5b81
+
b5b5b81
+# Provide virtual target "cfi" for targets supporting CFI.
b5b5b81
+
b5b5b81
+rename "istarget" "istarget_ld"
b5b5b81
+proc istarget { target } {
b5b5b81
+    if {$target == "cfi"} {
b5b5b81
+	return [check_as_cfi]
b5b5b81
+    }
b5b5b81
+    return [istarget_ld $target]
b5b5b81
+}