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] Allow mmix-knuth-mmixware adjustments to objcopy --extract-symbols test.


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

commit 282b7d7b65e928a59464b2a9a5e75555c97481dc
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date:   Thu Oct 22 09:28:40 2015 +0200

    Allow mmix-knuth-mmixware adjustments to objcopy --extract-symbols test.
    
    	* ld-scripts/script.exp (extract_symbol_test): Allow nm output of
    	objcopy --extract-symbols result to differ from original on
    	mmix-knuth-mmixware.

Diff:
---
 ld/testsuite/ChangeLog             |  6 ++++++
 ld/testsuite/ld-scripts/script.exp | 17 ++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 92d7ebf..a206247 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-22  Hans-Peter Nilsson  <hp@bitrange.com>
+
+	* ld-scripts/script.exp (extract_symbol_test): Allow nm output of
+	objcopy --extract-symbols result to differ from original on
+	mmix-knuth-mmixware.
+
 2015-10-22  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* ld-i386/call3.s: New file.
diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp
index b5f175f..e735bda 100644
--- a/ld/testsuite/ld-scripts/script.exp
+++ b/ld/testsuite/ld-scripts/script.exp
@@ -111,6 +111,7 @@ proc extract_symbol_test { testfile testname } {
     global objcopy
     global nm
     global size
+    global target_triplet
 
     set copyfile tmpdir/extract
     set args "--extract-symbol $testfile $copyfile"
@@ -121,8 +122,22 @@ proc extract_symbol_test { testfile testname } {
     }
 
     set orig_syms [run_host_cmd $nm $testfile]
+    set syms_massaged $orig_syms
+    switch -regexp $target_triplet {
+	^mmix-knuth-mmixware$ {
+	    # Without section sizes (stripped together with the
+	    # contents for this target), we can't deduce the symbol
+	    # types.  Artificially tracking the symbol types is
+	    # considered not worthwhile as there's no known use-case
+	    # for --extract-symbols for this target.  The option is
+	    # supported just enough to emit the same symbol values,
+	    # but absolute symbol types are expected.
+	    regsub -all " \[TD\] " $syms_massaged " A " syms_massaged
+	}
+    }
+
     set extract_syms [run_host_cmd $nm $copyfile]
-    if ![string equal $orig_syms $extract_syms] {
+    if ![string equal $syms_massaged $extract_syms] {
 	fail $testname
 	return
     }


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