Add is_generic_elf to ld/ld-lib.exp
authorAlan Modra <amodra@gmail.com>
Mon, 25 Jul 2016 02:36:52 +0000 (12:06 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 7 Oct 2016 00:22:13 +0000 (10:52 +1030)
* testsuite/lib/ld-lib.exp (is_generic_elf): New, extracted from..
* testsuite/ld-elf/elf.exp: ..here.

ld/ChangeLog
ld/testsuite/ld-elf/elf.exp
ld/testsuite/lib/ld-lib.exp

index d70cdf068bc6b37385f67494c2823a6091baf187..7be0a2acba7beaea349d96bb49f3f22bb58678c9 100644 (file)
@@ -1,3 +1,8 @@
+2016-10-07  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/lib/ld-lib.exp (is_generic_elf): New, extracted from..
+       * testsuite/ld-elf/elf.exp: ..here.
+
 2016-10-06  Ludovic Courtès  <ludo@gnu.org>
 
        * emulparams/elf32bmipn32-defs.sh: Shift quote of
index 872e7f14f52242fb2a3286a7fee7128b5f388996..59284bd37b7fd1e8806f298416dff64614720a42 100644 (file)
@@ -139,19 +139,7 @@ foreach t $test_list {
 # Targets using the generic linker backend don't support generating
 # an import library.
 set xfail_implib ""
-if { [istarget "d30v-*-*"]
-     || [istarget "dlx-*-*"]
-     || [istarget "fr30-*-*"]
-     || ([istarget "frv-*-*"] && ![istarget "frv-*-linux*"])
-     || [istarget "ft32-*-*"]
-     || [istarget "i860-*-*"]
-     || [istarget "i960-*-*"]
-     || [istarget "iq2000-*-*"]
-     || [istarget "mn10200-*-*"]
-     || [istarget "moxie-*-*"]
-     || [istarget "msp430-*-*"]
-     || [istarget "mt-*-*"]
-     || [istarget "pj*-*-*"] } {
+if [is_generic_elf] {
     set xfail_implib "*-*-*"
 }
 
index 616ac51c88515d555709b3238884e4b23c8b91f9..49c1fb162bbfd46ee37f3e928f3f77f63c8f3bbc 100644 (file)
@@ -1773,6 +1773,26 @@ proc check_shared_lib_support { } {
     return 0
 }
 
+# Return true if target uses genelf.em (assuming it is ELF).
+proc is_generic_elf { } {
+    if { [istarget "d30v-*-*"]
+        || [istarget "dlx-*-*"]
+        || [istarget "fr30-*-*"]
+        || ([istarget "frv-*-*"] && ![istarget "frv-*-linux*"])
+        || [istarget "ft32-*-*"]
+        || [istarget "i860-*-*"]
+        || [istarget "i960-*-*"]
+        || [istarget "iq2000-*-*"]
+        || [istarget "mn10200-*-*"]
+        || [istarget "moxie-*-*"]
+        || [istarget "msp430-*-*"]
+        || [istarget "mt-*-*"]
+        || [istarget "pj*-*-*"] } {
+       return 1;
+    }
+    return 0;
+}
+
 # Returns true if the target ld supports the plugin API.
 proc check_plugin_api_available { } {
     global plugin_api_available_saved