Allow mmix-knuth-mmixware adjustments to objcopy --extract-symbols test.
authorHans-Peter Nilsson <hp@bitrange.com>
Thu, 22 Oct 2015 07:28:40 +0000 (09:28 +0200)
committerHans-Peter Nilsson <hp@bitrange.com>
Thu, 22 Oct 2015 14:16:09 +0000 (16:16 +0200)
* ld-scripts/script.exp (extract_symbol_test): Allow nm output of
objcopy --extract-symbols result to differ from original on
mmix-knuth-mmixware.

ld/testsuite/ChangeLog
ld/testsuite/ld-scripts/script.exp

index 92d7ebf0aebc50ebec17e33d5cff224a9651b344..a2062471a37c3b9ae932604ff29323ae04b84a4e 100644 (file)
@@ -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.
index b5f175f2b1f9821d94b16aa6b384c3b65390d928..e735bdacf34d2bb00dd1bd059728b6cf6e07cd39 100644 (file)
@@ -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
     }
This page took 0.035026 seconds and 4 git commands to generate.