This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [PATCH] [MIPS] LD/testsuite: Skip 32bit test if ld not support.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3da65cd27e9b36ab205ce7820ce566534272da22

commit 3da65cd27e9b36ab205ce7820ce566534272da22
Author: Chenghua Xu <paul.hua.gm@gmail.com>
Date:   Fri Aug 24 21:25:15 2018 +0800

    [PATCH] [MIPS] LD/testsuite: Skip 32bit test if ld not support.
    
    ld/ChangeLog:
    
        * testsuite/ld-mips-elf/mips-elf-flags.exp
        (check_ld_support_32bit, check_is_32bit_args): New procedures.
        (good_combination, bad_combination): Skip 32bit test if ld
        not support 32bit emulations.

Diff:
---
 ld/ChangeLog                                |  7 +++++
 ld/testsuite/ld-mips-elf/mips-elf-flags.exp | 40 +++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index 942843c..5488c85 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2018-08-24  Chenghua Xu  <paul.hua.gm@gmail.com>
+
+	* testsuite/ld-mips-elf/mips-elf-flags.exp
+	(check_ld_support_32bit, check_is_32bit_args): New procedures.
+	(good_combination, bad_combination): Skip 32bit test if ld
+	not support 32bit emulations.
+
 2018-08-24  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* testsuite/ld-i386/i386.exp: Run pr23372c, pr23372d, pr23486c
diff --git a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
index 654f8ae..de97939 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf-flags.exp
@@ -36,6 +36,32 @@ if {[istarget mips*-*-irix6*]} {
     set ldemul ""
 }
 
+# Check is ld supported 32bit emulations.
+proc check_ld_support_32bit { } {
+    global ld
+    global echo
+
+    set ld_output [remote_exec host $ld "-V"]
+    if [string match "*elf32*" $ld_output] then {
+	return 1
+    } else {
+	return 0
+    }
+}
+
+# Check args is 32bit abis.
+proc check_is_32bit_args {arg} {
+
+    if { [string match "*-32*" $arg]
+         || [string match "*-mabi=32*" $arg]
+         || [string match "*-mabi=o64*" $arg]
+         || [string match "*-mgp32*" $arg] } {
+	return 1
+    } else {
+	return 0
+    }
+}
+
 # Assemble jr.s using each of the argument lists in ARGLIST.  Return the
 # list of object files on success and an empty list on failure.
 proc assemble_for_flags {arglist} {
@@ -70,6 +96,13 @@ proc good_combination {arglist flags args} {
     set testname "MIPS compatible objects: $arglist"
     set objs [assemble_for_flags $arglist]
 
+    foreach argsl $arglist {
+        if { [check_is_32bit_args $argsl] && ![check_ld_support_32bit] } {
+	    unsupported $testname
+	    return 0
+	}
+    }
+
     if {$objs == ""} {
 	unresolved $testname
     } elseif {![ld_link "$ld $ldemul" $finalobj "-r $objs"]} {
@@ -156,6 +189,13 @@ proc bad_combination {arglist message} {
     set testname "MIPS incompatible objects: $arglist"
     set objs [assemble_for_flags $arglist]
 
+    foreach argsl $arglist {
+        if { [check_is_32bit_args $argsl] && ![check_ld_support_32bit] } {
+	    unsupported $testname
+	    return 0
+	}
+    }
+
     if {$objs == ""} {
 	unresolved $testname
     } elseif {[ld_link "$ld $ldemul" $finalobj "-r $objs"]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]