]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
apply mainline testsuite fixes and tweaks
authorAlan Modra <amodra@gmail.com>
Thu, 10 Feb 2011 03:41:11 +0000 (03:41 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 10 Feb 2011 03:41:11 +0000 (03:41 +0000)
140 files changed:
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/elfedit-2.d
binutils/testsuite/binutils-all/elfedit-3.d
binutils/testsuite/binutils-all/i386/i386.exp
binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/binutils-all/strip-3.d
binutils/testsuite/lib/binutils-common.exp
binutils/testsuite/lib/utils-lib.exp
gas/testsuite/ChangeLog
gas/testsuite/gas/all/gas.exp
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/m68k/all.exp
gas/testsuite/gas/mep/complex-relocs.exp
gas/testsuite/gas/mt/relocs.exp
gas/testsuite/gas/symver/symver.exp
gas/testsuite/lib/gas-defs.exp
ld/ChangeLog
ld/configure.host
ld/testsuite/ChangeLog
ld/testsuite/ld-bootstrap/bootstrap.exp
ld/testsuite/ld-discard/discard.exp
ld/testsuite/ld-elf/binutils.exp
ld/testsuite/ld-elf/commonpage1.d
ld/testsuite/ld-elf/compress1c.d
ld/testsuite/ld-elf/discard1.d
ld/testsuite/ld-elf/discard2.d
ld/testsuite/ld-elf/discard3.d
ld/testsuite/ld-elf/dynsym1.d
ld/testsuite/ld-elf/eh6.d
ld/testsuite/ld-elf/elf.exp
ld/testsuite/ld-elf/hash.d
ld/testsuite/ld-elf/header.d
ld/testsuite/ld-elf/loadaddr1.d
ld/testsuite/ld-elf/loadaddr2.d
ld/testsuite/ld-elf/loadaddr3a.d
ld/testsuite/ld-elf/loadaddr3b.d
ld/testsuite/ld-elf/local1.d
ld/testsuite/ld-elf/maxpage1.d
ld/testsuite/ld-elf/maxpage2.d
ld/testsuite/ld-elf/maxpage3a.d
ld/testsuite/ld-elf/multibss1.d
ld/testsuite/ld-elf/noload-2.d
ld/testsuite/ld-elf/pr9676.rd
ld/testsuite/ld-elf/pr9679.rd
ld/testsuite/ld-elf/seg.d
ld/testsuite/ld-elf/textaddr1.d
ld/testsuite/ld-elf/textaddr2.d
ld/testsuite/ld-elf/textaddr3.d
ld/testsuite/ld-elf/textaddr4.d
ld/testsuite/ld-elf/textaddr5.d
ld/testsuite/ld-elf/textaddr6.d
ld/testsuite/ld-elf/textaddr7.d
ld/testsuite/ld-elf/tls_common.exp
ld/testsuite/ld-elf/unknown2.d
ld/testsuite/ld-elfcomm/elfcomm.exp
ld/testsuite/ld-elfvers/vers.exp
ld/testsuite/ld-elfvers/vers1.c
ld/testsuite/ld-elfvers/vers1.dsym
ld/testsuite/ld-elfvers/vers1.sym
ld/testsuite/ld-elfvers/vers15.c
ld/testsuite/ld-elfvers/vers15.dsym
ld/testsuite/ld-elfvers/vers15.sym
ld/testsuite/ld-elfvers/vers16.dsym
ld/testsuite/ld-elfvers/vers16a.dsym
ld/testsuite/ld-elfvers/vers17.dsym
ld/testsuite/ld-elfvers/vers18.c
ld/testsuite/ld-elfvers/vers18.dsym
ld/testsuite/ld-elfvers/vers18.sym
ld/testsuite/ld-elfvers/vers19.dsym
ld/testsuite/ld-elfvers/vers2.dsym
ld/testsuite/ld-elfvers/vers20.dsym
ld/testsuite/ld-elfvers/vers21.c
ld/testsuite/ld-elfvers/vers21.dsym
ld/testsuite/ld-elfvers/vers21.sym
ld/testsuite/ld-elfvers/vers22.dsym
ld/testsuite/ld-elfvers/vers22a.c
ld/testsuite/ld-elfvers/vers22a.dsym
ld/testsuite/ld-elfvers/vers22a.sym
ld/testsuite/ld-elfvers/vers22b.dsym
ld/testsuite/ld-elfvers/vers23.dsym
ld/testsuite/ld-elfvers/vers23a.c
ld/testsuite/ld-elfvers/vers23a.dsym
ld/testsuite/ld-elfvers/vers23a.sym
ld/testsuite/ld-elfvers/vers23b.dsym
ld/testsuite/ld-elfvers/vers23d.dsym
ld/testsuite/ld-elfvers/vers24.rd
ld/testsuite/ld-elfvers/vers24a.c
ld/testsuite/ld-elfvers/vers24c.c
ld/testsuite/ld-elfvers/vers25a.dsym
ld/testsuite/ld-elfvers/vers26a.dsym
ld/testsuite/ld-elfvers/vers27a.dsym
ld/testsuite/ld-elfvers/vers27b.c
ld/testsuite/ld-elfvers/vers27d.dsym
ld/testsuite/ld-elfvers/vers27d.sym
ld/testsuite/ld-elfvers/vers27d1.c
ld/testsuite/ld-elfvers/vers27d4.dsym
ld/testsuite/ld-elfvers/vers28b.dsym
ld/testsuite/ld-elfvers/vers28c.dsym
ld/testsuite/ld-elfvers/vers29.dsym
ld/testsuite/ld-elfvers/vers3.dsym
ld/testsuite/ld-elfvers/vers30.dsym
ld/testsuite/ld-elfvers/vers31.dsym
ld/testsuite/ld-elfvers/vers32a.dsym
ld/testsuite/ld-elfvers/vers32b.dsym
ld/testsuite/ld-elfvers/vers4.c
ld/testsuite/ld-elfvers/vers4.sym
ld/testsuite/ld-elfvers/vers4a.dsym
ld/testsuite/ld-elfvers/vers4a.sym
ld/testsuite/ld-elfvers/vers5.c
ld/testsuite/ld-elfvers/vers6.c
ld/testsuite/ld-elfvers/vers6.dsym
ld/testsuite/ld-elfvers/vers6.sym
ld/testsuite/ld-elfvers/vers7a.c
ld/testsuite/ld-elfvers/vers7a.dsym
ld/testsuite/ld-elfvers/vers7a.sym
ld/testsuite/ld-elfvers/vers9.c
ld/testsuite/ld-elfvers/vers9.dsym
ld/testsuite/ld-elfvers/vers9.sym
ld/testsuite/ld-elfvsb/elfvsb.exp
ld/testsuite/ld-elfweak/elfweak.exp
ld/testsuite/ld-gc/abi-note.d
ld/testsuite/ld-gc/gc.exp
ld/testsuite/ld-gc/pr11218-2.c
ld/testsuite/ld-gc/pr11218.d
ld/testsuite/ld-gc/start.d
ld/testsuite/ld-i386/i386.exp
ld/testsuite/ld-ifunc/binutils.exp
ld/testsuite/ld-ifunc/ifunc.exp
ld/testsuite/ld-linkonce/linkonce.exp
ld/testsuite/ld-linkonce/zeroehl32.d
ld/testsuite/ld-pie/pie.exp
ld/testsuite/ld-scripts/phdrs2.exp
ld/testsuite/ld-scripts/rgn-at5.d
ld/testsuite/ld-scripts/script.exp
ld/testsuite/ld-selective/selective.exp
ld/testsuite/ld-shared/shared.exp
ld/testsuite/ld-undefined/entry-3.d
ld/testsuite/ld-undefined/entry-4.d
ld/testsuite/ld-undefined/weak-undef.exp
ld/testsuite/lib/ld-lib.exp

index a2960c663faeb630a988957783a707609cf29575..678f82aef04b2d43cdca5ad084088addb43f5fd3 100644 (file)
@@ -1,3 +1,24 @@
+2011-02-10  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2010-11-20  Richard Sandiford  <rdsandiford@googlemail.com>
+       * lib/binutils-common.exp (regexp_diff): New procedure.
+       * lib/utils-lib.exp (regexp_diff): Delete.
+
+       2010-11-20  Richard Sandiford  <rdsandiford@googlemail.com>
+       * lib/binutils-common.exp: New file.
+       * lib/utils-lib.exp (load_common_lib): New function.  Load
+       binutils-common.exp.
+       (is_elf_format): Delete.
+
+       2010-11-08  Thomas Schwinge  <thomas@schwinge.name>
+       * lib/utils-lib.exp (is_elf_format): Consider for *-*-gnu*, too.
+       * binutils-all/elfedit-2.d (target): Likewise.
+       * binutils-all/elfedit-3.d (target): Likewise.
+       * binutils-all/i386/i386.exp: Likewise.
+       * binutils-all/objcopy.exp: Likewise.
+       * binutils-all/strip-3.d (target): Likewise.
+
 2011-02-01  Alan Modra  <amodra@gmail.com>
 
        Backport from mainline
index af07c1db2977bfd21b750ded723c688092c72509..56468b51fc05c2e712da1dfa46af51fcea6e7e3a 100644 (file)
@@ -3,7 +3,7 @@
 #source: empty.s
 #readelf: -h
 #name: Update ELF header 2
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
 ELF Header:
index c877f46ef29a218e3dc8f88b1b142c01f1f306f7..219cac5919b9f3741fa7feffe1b6d1aec3881604 100644 (file)
@@ -3,7 +3,7 @@
 #source: empty.s
 #readelf: -h
 #name: Update ELF header 3
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
 ELF Header:
index 2ca4bd535f005977ea88b887540683fcb98ae747..5b33e67f2c6a63e052c303ef756c1cc13e1e45bc 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 
-if {!([istarget "i*86-*-linux*"] || [istarget "x86_64-*-linux*"]) || ![is_elf_format] || [is_remote host]} then {
+if {!([istarget "i*86-*-linux*"]
+      || [istarget "i*86-*-gnu*"]
+      || [istarget "x86_64-*-linux*"])
+    || ![is_elf_format]
+    || [is_remote host]} then {
     return
 }
 
index c93372c2f4888f76825e7f5493d1b720d746675b..0e2345e5cd1fbdc48d43b11357f8c23a92af3f86 100644 (file)
@@ -538,7 +538,8 @@ proc copy_setup { } {
        set add_libs ""
     }
 
-    if { [istarget *-*-linux*] } {
+    if { [istarget *-*-linux*]
+        || [istarget *-*-gnu*] } {
        foreach i $gcc_gas_flag {
            set flags "additional_flags=$i $flags"
        }
index d6566977001757b94e27daddf43d06fbac8553f4..acfec85d7a841af30ee6ef6565a98d6f28e17a48 100644 (file)
@@ -3,7 +3,7 @@
 #strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .pdr -R .xtensa.info
 #readelf: -S --wide
 #name: strip empty file
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   \[[ 0]+\][ \t]+NULL[ \t]+.*
index 8e2c36f504a9f99f85f33dbd11e8384f9b97daef..2f8b42652824f3475688a4112f5a0a8ff3f3382b 100644 (file)
@@ -167,9 +167,7 @@ proc is_elf64 { binary_file } {
 #    REGEXP
 #        Skip all lines in FILE_1 until the first that matches REGEXP.
 #
-# Other # lines are comments.  Regexp lines starting with the `!' character
-# specify inverse matching (use `\!' for literal matching against a leading
-# `!').  Skip empty lines in both files.
+# Other # lines are comments.  Skip empty lines in both files.
 #
 # The first optional argument is a list of regexp substitutions of the form:
 #
@@ -237,15 +235,12 @@ proc regexp_diff { file_1 file_2 args } {
                    set diff_pass 1
                    break
                }
-               set negated [expr { [string index $line_b 0] == "!" }]
-               set line_bx [string range $line_b $negated end]
-               set n [expr { $negated ? "! " : "" }]
                # Substitute on the reference.
                foreach {name value} $ref_subst {
-                   regsub -- $name $line_bx $value line_bx
+                   regsub -- $name $line_b $value line_b
                }
-               verbose "looking for $n\"^$line_bx$\"" 3
-               while { [expr [regexp "^$line_bx$" "$line_a"] == $negated] } {
+               verbose "looking for \"^$line_b$\"" 3
+               while { ![regexp "^$line_b$" "$line_a"] } {
                    verbose "skipping    \"$line_a\"" 3
                    if { [gets $file_a line_a] == $eof } {
                        set end_1 1
@@ -275,18 +270,14 @@ proc regexp_diff { file_1 file_2 args } {
            set differences 1
            break
        } else {
-           set negated [expr { [string index $line_b 0] == "!" }]
-           set line_bx [string range $line_b $negated end]
-           set n [expr { $negated ? "! " : "" }]
-           set s [expr { $negated ? "  " : "" }]
            # Substitute on the reference.
            foreach {name value} $ref_subst {
-               regsub -- $name $line_bx $value line_bx
+               regsub -- $name $line_b $value line_b
            }
-           verbose "regexp $n\"^$line_bx$\"\nline   \"$line_a\"" 3
-           if { [expr [regexp "^$line_bx$" "$line_a"] == $negated] } {
+           verbose "regexp \"^$line_b$\"\nline   \"$line_a\"" 3
+           if { ![regexp "^$line_b$" "$line_a"] } {
                send_log "regexp_diff match failure\n"
-               send_log "regexp $n\"^$line_bx$\"\nline   $s\"$line_a\"\n"
+               send_log "regexp \"^$line_b$\"\nline   \"$line_a\"\n"
                verbose "regexp_diff match failure\n" 3
                set differences 1
            }
index db170d387a51e429435e8a9fe089ff04887b03a6..72e368cbb393d08779a450b054ec4833d5b67e95 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007,
-# 2009 Free Software Foundation, Inc.
+# 2009, 2010 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # This file was written by Rob Savoye <rob@cygnus.com>
 # and extended by Ian Lance Taylor <ian@cygnus.com>
 
+proc load_common_lib { name } {
+    load_lib $name
+}
+
+load_common_lib binutils-common.exp
+
 proc binutil_version { prog } {
     if ![is_remote host] {
        set path [which $prog]
@@ -118,62 +124,6 @@ proc default_binutils_assemble_flags { source object asflags } {
     }
 }
 
-# True if the object format is known to be ELF.
-#
-proc is_elf_format {} {
-    if { ![istarget *-*-sysv4*]
-        && ![istarget *-*-unixware*]
-        && ![istarget *-*-elf*]
-        && ![istarget *-*-eabi*]
-        && ![istarget *-*-rtems*]
-        && ![istarget hppa*64*-*-hpux*]
-        && ![istarget ia64-*-hpux*]
-        && ![istarget *-*-linux*]
-        && ![istarget frv-*-uclinux*]
-        && ![istarget bfin-*-uclinux]
-        && ![istarget sh*-*-uclinux*]
-        && ![istarget *-*-irix5*]
-        && ![istarget *-*-irix6*]
-        && ![istarget *-*-netbsd*]
-        && ![istarget *-*-openbsd*]
-        && ![istarget *-*-solaris2*] } {
-       return 0
-    }
-
-    if { [istarget *-*-linux*aout*]
-        || [istarget *-*-linux*oldld*]
-        || [istarget h8500-*-rtems*]
-        || [istarget i960-*-rtems*]
-        || [istarget *-*-rtemscoff*] } {
-       return 0
-    }
-
-    if { ![istarget *-*-netbsdelf*]
-        && ([istarget *-*-netbsd*aout*]
-            || [istarget *-*-netbsdpe*]
-            || [istarget arm*-*-netbsd*]
-            || [istarget sparc-*-netbsd*]
-            || [istarget i*86-*-netbsd*]
-            || [istarget m68*-*-netbsd*]
-            || [istarget vax-*-netbsd*]
-            || [istarget ns32k-*-netbsd*]) } {
-       return 0
-    }
-
-    if { [istarget arm-*-openbsd*]
-        || [istarget i386-*-openbsd\[0-2\].*]
-        || [istarget i386-*-openbsd3.\[0-2\]]
-        || [istarget m68*-*-openbsd*]
-        || [istarget ns32k-*-openbsd*]
-        || [istarget sparc-*-openbsd\[0-2\].*]
-        || [istarget sparc-*-openbsd3.\[0-1\]]
-        || [istarget vax-*-openbsd*] } {
-       return 0
-    }
-
-    return 1
-}
-
 #
 # exe_ext
 #      Returns target executable extension, if any.
@@ -292,8 +242,8 @@ proc exe_ext {} {
 #
 # After the option lines come regexp lines.  `run_dump_test' calls
 # `regexp_diff' to compare the output of the dumping tool against the
-# regexps in FILE.d.  `regexp_diff' is defined later in this file; see
-# further comments there.
+# regexps in FILE.d.  `regexp_diff' is defined in binutils-common.exp;
+# see further comments there.
 
 proc run_dump_test { name {extra_options {}} } {
     global subdir srcdir
@@ -588,110 +538,6 @@ proc slurp_options { file } {
     return $opt_array
 }
 
-# regexp_diff, based on simple_diff taken from ld test suite
-#      compares two files line-by-line
-#      file1 contains strings, file2 contains regexps and #-comments
-#      blank lines are ignored in either file
-#      returns non-zero if differences exist
-#
-proc regexp_diff { file_1 file_2 } {
-
-    set eof -1
-    set end_1 0
-    set end_2 0
-    set differences 0
-    set diff_pass 0
-
-    if [file exists $file_1] then {
-       set file_a [open $file_1 r]
-    } else {
-       perror "$file_1 doesn't exist"
-       return 1
-    }
-
-    if [file exists $file_2] then {
-       set file_b [open $file_2 r]
-    } else {
-       perror "$file_2 doesn't exist"
-       close $file_a
-       return 1
-    }
-
-    verbose " Regexp-diff'ing: $file_1 $file_2" 2
-
-    while { 1 } {
-       set line_a ""
-       set line_b ""
-       while { [string length $line_a] == 0 } {
-           if { [gets $file_a line_a] == $eof } {
-               set end_1 1
-               break
-           }
-       }
-       while { [string length $line_b] == 0 || [string match "#*" $line_b] } {
-           if [ string match "#pass" $line_b ] {
-               set end_2 1
-               set diff_pass 1
-               break
-           } elseif [ string match "#..." $line_b ] {
-               if { [gets $file_b line_b] == $eof } {
-                   set end_2 1
-                   set diff_pass 1
-                   break
-               }
-               verbose "looking for \"^$line_b$\"" 3
-               while { ![regexp "^$line_b$" "$line_a"] } {
-                   verbose "skipping    \"$line_a\"" 3
-                   if { [gets $file_a line_a] == $eof } {
-                       set end_1 1
-                       break
-                   }
-               }
-               break
-           }
-           if { [gets $file_b line_b] == $eof } {
-               set end_2 1
-               break
-           }
-       }
-
-        if { $diff_pass } {
-            break
-        } elseif { $end_1 && $end_2 } {
-            break
-        } elseif { $end_1 } {
-            send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n"
-            verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3
-            set differences 1
-            break
-        } elseif { $end_2 } {
-            send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n"
-            verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3
-            set differences 1
-            break
-        } else {
-            verbose "regexp \"^$line_b$\"\nline   \"$line_a\"" 3
-            if ![regexp "^$line_b$" "$line_a"] {
-               send_log "regexp_diff match failure\n"
-               send_log "regexp \"^$line_b$\"\nline   \"$line_a\"\n"
-               verbose "regexp_diff match failure\n" 3
-               set differences 1
-            }
-        }
-    }
-
-    if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } {
-       send_log "$file_1 and $file_2 are different lengths\n"
-       verbose "$file_1 and $file_2 are different lengths" 3
-       set differences 1
-    }
-
-    close $file_a
-    close $file_b
-
-    return $differences
-}
-
 proc file_contents { filename } {
     set file [open $filename r]
     set contents [read $file]
index 06df39f64dd21a8c079ad4ecf18fe6df1636110c..f66ce9d567bf72ab375009402144ca6d9b83aa83 100644 (file)
@@ -1,3 +1,28 @@
+2011-02-10  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2010-11-20  Richard Sandiford  <rdsandiford@googlemail.com>
+       * lib/gas-defs.exp (regexp_diff): Delete.
+       (run_dump_test): Remove final "" argument in call to regexp_diff.
+       (run_list_test): Likewise.
+       (run_list_test_stdin): Likewise.
+       * gas/all/gas.exp (test_cond): Likewise.
+       * gas/elf/elf.exp (run_elf_list_test): Likewise.
+       * gas/m68k/all.exp: Likewise.
+       * gas/mep/complex-relocs.exp (regexp_test): Likewise.
+       * gas/mt/relocs.exp (regexp_test): Likewise.
+       * gas/symver/symver.exp (run_error_test): Likewise.
+
+       2010-11-20  Richard Sandiford  <rdsandiford@googlemail.com>
+       * lib/gas-defs.exp (load_common_lib): New function.  Load
+       binutils-common.exp.
+       (is_elf_format, is_aout_format, is_pecoff_format): Delete.
+
+       2010-11-08  Thomas Schwinge  <thomas@schwinge.name>
+       * lib/gas-defs.exp (is_elf_format): Consider for *-*-gnu*, too.
+       * gas/elf/elf.exp: Likewise.
+       * gas/symver/symver.exp: Likewise.
+
 2011-02-07  Vincent Riviere  <vincent.riviere@freesbee.fr>
 
        PR gas/3041
index 1dd7cbb025b1c77d631f738a7ed1e8697589ed2f..c41db983c12c0fe950a6d7d2b27ef6dadae3cde5 100644 (file)
@@ -308,7 +308,7 @@ proc test_cond {} {
        send_log "$comp_output\n"
        fail $testname
     } else {
-       if { [regexp_diff dump.out $srcdir/$subdir/cond.l ""] } {
+       if { [regexp_diff dump.out $srcdir/$subdir/cond.l] } {
            fail $testname
        } else {
            pass $testname
index 5ce538a3170de1d01747a6263c295b6b419aca3d..3babe0b1cb4948f8d7cca1b66027c2c60c5e0a60 100644 (file)
@@ -9,7 +9,7 @@ proc run_elf_list_test { name suffix opts readelf_opts readelf_pipe } {
     set file $srcdir/$subdir/$name
     gas_run ${name}.s "$opts -o dump.o" ">&dump.out"
     if { ![string match "" $opts]
-         && [regexp_diff "dump.out" "${file}.l" ""] } then {
+         && [regexp_diff "dump.out" "${file}.l"] } then {
        fail $testname
        verbose "output is [file_contents "dump.out"]" 2
        return
@@ -28,7 +28,7 @@ proc run_elf_list_test { name suffix opts readelf_opts readelf_pipe } {
        return
     }
     verbose_eval {[file_contents "dump.out"]} 3
-    if { [regexp_diff "dump.out" "${file}.e${suffix}" ""] } then {
+    if { [regexp_diff "dump.out" "${file}.e${suffix}"] } then {
        fail $testname
        verbose "output is [file_contents "dump.out"]" 2
        return
@@ -39,6 +39,7 @@ proc run_elf_list_test { name suffix opts readelf_opts readelf_pipe } {
 # We're testing bits in obj-elf -- don't run on anything else.
 if { ([istarget "*-*-*elf*"]
       || [istarget "*-*-linux*"]
+      || [istarget "*-*-gnu*"]
       || [istarget "m6811-*"]
       || [istarget "m6812-*"]
       || [istarget "sparc*-*-solaris*"]
index 8b9ecdb606f6164a8fb20da5692912cbdb87cec5..b3db085a6782ca07e96820322ccb5cab6e935cfc 100644 (file)
@@ -84,7 +84,7 @@ if { [istarget m68*-*-*] || [istarget fido*-*-*] } then {
        verbose "$comp_output" 3
        fail $testname
     } else {
-       if [regexp_diff "err.out" "$srcdir/$subdir/op68000.d" ""] then {
+       if [regexp_diff "err.out" "$srcdir/$subdir/op68000.d"] then {
            fail $testname
        } else {
            pass $testname
index a5a3127fb1f50913dd955c842da72a0bfd69bbda..83d89bb6375d8352bf35b108f517239c0aec2708 100644 (file)
@@ -18,7 +18,7 @@ proc objdump_test { exec flags dest test } {
 }
 
 proc regexp_test { file1 file2 test } {
-    if [regexp_diff $file1 $file2 ""] then { fail $test } else { pass $test }
+    if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
 }
 
 
index d47742ebf32e2eb7855591898b8e8789f3b56338..076f428bc73b30d8182543fbf72a201a790fc5e7 100644 (file)
@@ -15,7 +15,7 @@ proc objdump_test { exec flags dest test } {
 }
 
 proc regexp_test { file1 file2 test } {
-    if [regexp_diff $file1 $file2 ""] then { fail $test } else { pass $test }
+    if [regexp_diff $file1 $file2] then { fail $test } else { pass $test }
 }
 
 
index 737bc85e40a2b9ba2c0b53c3c00b6c366cab018a..6fcae0edab206fc8aa60f3ef9ee77cdcd402b847 100644 (file)
@@ -6,7 +6,7 @@ proc run_error_test { name opts } {
     set testname "symver $name"
     set file $srcdir/$subdir/$name
     gas_run ${name}.s $opts ">&dump.out"
-    if { [regexp_diff "dump.out" "${file}.l" ""] } then {
+    if { [regexp_diff "dump.out" "${file}.l"] } then {
        fail $testname
        verbose "output is [file_contents "dump.out"]" 2
        return
@@ -18,7 +18,8 @@ proc run_error_test { name opts } {
 if { ([istarget "*-*-elf*"]            
       || [istarget "m6811-*"]
       || [istarget "m6812-*"]
-      || [istarget "*-*-linux*"])
+      || [istarget "*-*-linux*"]
+      || [istarget "*-*-gnu*"])
      && ![istarget *-*-linux*aout*]
      && ![istarget *-*-linux*oldld*] } then {
 
index 8e14101ac709dfd24116ea7d0b86c7a90e2b45b3..f10d72adce7d9653845eb32354decbc4c29fa95a 100644 (file)
@@ -1,5 +1,5 @@
 # Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-# 2004, 2005, 2007, 2008, 2009  Free Software Foundation, Inc.
+# 2004, 2005, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 
 # This file was written by Ken Raeburn (raeburn@cygnus.com).
 
+proc load_common_lib { name } {
+    global srcdir
+    load_file $srcdir/../../binutils/testsuite/lib/$name
+}
+
+load_common_lib binutils-common.exp
+
 proc gas_version {} {
     global AS
     if [is_remote host] then {
@@ -277,112 +284,6 @@ proc gas_init { args } {
     return
 }
 
-# True if the object format is known to be ELF.
-#
-proc is_elf_format {} {
-    if { ![istarget *-*-sysv4*]
-        && ![istarget *-*-unixware*]
-        && ![istarget *-*-elf*]
-        && ![istarget *-*-eabi*]
-        && ![istarget *-*-rtems*]
-        && ![istarget hppa*64*-*-hpux*]
-        && ![istarget ia64-*-hpux*]
-        && ![istarget *-*-linux*]
-        && ![istarget frv-*-uclinux*]
-        && ![istarget bfin-*-uclinux]
-        && ![istarget sh*-*-uclinux*]
-        && ![istarget *-*-irix5*]
-        && ![istarget *-*-irix6*]
-        && ![istarget *-*-netbsd*]
-        && ![istarget *-*-openbsd*]
-        && ![istarget *-*-solaris2*] } {
-       return 0
-    }
-
-    if { [istarget *-*-linux*aout*]
-        || [istarget *-*-linux*oldld*]
-        || [istarget h8500-*-rtems*]
-        || [istarget i960-*-rtems*]
-        || [istarget *-*-rtemscoff*] } {
-       return 0
-    }
-
-    if { ![istarget *-*-netbsdelf*]
-        && ([istarget *-*-netbsd*aout*]
-            || [istarget *-*-netbsdpe*]
-            || [istarget arm*-*-netbsd*]
-            || [istarget sparc-*-netbsd*]
-            || [istarget i*86-*-netbsd*]
-            || [istarget m68*-*-netbsd*]
-            || [istarget vax-*-netbsd*]
-            || [istarget ns32k-*-netbsd*]) } {
-       return 0
-    }
-
-    if { [istarget arm-*-openbsd*]
-        || [istarget i386-*-openbsd\[0-2\].*]
-        || [istarget i386-*-openbsd3.\[0-2\]]
-        || [istarget m68*-*-openbsd*]
-        || [istarget ns32k-*-openbsd*]
-        || [istarget sparc-*-openbsd\[0-2\].*]
-        || [istarget sparc-*-openbsd3.\[0-1\]]
-        || [istarget vax-*-openbsd*] } {
-       return 0
-    }
-
-    return 1
-}
-
-# True if the object format is known to be a.out.
-#
-proc is_aout_format {} {
-    if { [istarget *-*-netbsdelf]
-        || [istarget sparc64-*-netbsd*]
-        || [istarget sparc64-*-openbsd*] } {
-       return 0
-    }
-    if { [istarget *-*-*\[ab\]out*]
-        || [istarget *-*-linux*oldld*]
-        || [istarget *-*-bsd*]
-        || [istarget *-*-msdos*]
-        || [istarget arm-*-netbsd*]
-        || [istarget arm-*-openbsd*]
-        || [istarget arm-*-riscix*]
-        || [istarget i?86-*-freebsd\[12\]*]
-        || [istarget i?86-*-netbsd*]
-        || [istarget i?86-*-openbsd\[0-2\]*]
-        || [istarget i?86-*-openbsd3.\[0-2\]*]
-        || [istarget i?86-*-vsta]
-        || [istarget i?86-*-mach*]
-        || [istarget m68*-*-netbsd*]
-        || [istarget m68*-*-openbsd*]
-        || [istarget ns32k-*-*]
-        || [istarget pdp11-*-*]
-        || [istarget sparc*-*-sunos4*]
-        || [istarget sparc*-*-netbsd*]
-        || [istarget sparc*-*-openbsd\[0-2\]*]
-        || [istarget sparc*-*-openbsd3.\[0-1\]*]
-        || [istarget sparc*-fujitsu-none]
-        || [istarget vax-dec-ultrix*]
-        || [istarget vax-*-netbsd] } {
-       return 1
-    }
-    return 0
-}
-
-# True if the object format is known to be PE COFF.
-#
-proc is_pecoff_format {} {
-    if { ![istarget *-*-mingw*]
-        && ![istarget *-*-cygwin*]
-        && ![istarget *-*-cegcc*]
-        && ![istarget *-*-pe*] } {
-       return 0
-    }
-
-    return 1
-}
-
 # Internal procedure: return the names of the standard sections
 #
 proc get_standard_section_names {} {
@@ -526,8 +427,8 @@ proc run_dump_tests { testcases {extra_options {}} } {
 #
 # After the option lines come regexp lines.  `run_dump_test' calls
 # `regexp_diff' to compare the output of the dumping tool against the
-# regexps in FILE.d.  `regexp_diff' is defined later in this file; see
-# further comments there.
+# regexps in FILE.d.  `regexp_diff' is defined in binutils-common.exp;
+# see further comments there.
 
 proc run_dump_test { name {extra_options {}} } {
     global subdir srcdir
@@ -778,7 +679,7 @@ proc run_dump_test { name {extra_options {}} } {
            }
            set stderrfile $srcdir/$subdir/$opts(stderr)
            verbose "wrote pruned stderr to dump.stderr" 3
-           if { [regexp_diff "dump.stderr" "$stderrfile" ""] } then {
+           if { [regexp_diff "dump.stderr" "$stderrfile"] } then {
                if { $opts(error) != "" } {
                    verbose -log "$exitstat with: <$comp_output>, expected: <$opts(error)>"
                    if [regexp $opts(error) $comp_output] {
@@ -938,120 +839,6 @@ expect_after -i {
     eof                                { perror "eof" }
 }
 
-# regexp_diff, based on simple_diff taken from ld test suite.
-#      Compares two files line-by-line.
-#      FILE_1 contains strings, FILE_2 contains regexps and #-comments
-#      Blank lines are ignored in either file.
-#      Subsitutions in REF_SUBST are applied on FILE_2 lines.
-#      Returns non-zero if differences exist.
-#
-proc regexp_diff { file_1 file_2 ref_subst} {
-
-    set eof -1
-    set end_1 0
-    set end_2 0
-    set differences 0
-    set diff_pass 0
-
-    if [file exists $file_1] then {
-       set file_a [open $file_1 r]
-    } else {
-       perror "$file_1 doesn't exist"
-       return 1
-    }
-
-    if [file exists $file_2] then {
-       set file_b [open $file_2 r]
-    } else {
-       perror "$file_2 doesn't exist"
-       close $file_a
-       return 1
-    }
-
-    verbose " Regexp-diff'ing: $file_1 $file_2" 2
-
-    while { 1 } {
-       set line_a ""
-       set line_b ""
-       while { [string length $line_a] == 0 } {
-            # Ignore blank line in FILE_1.
-           if { [gets $file_a line_a] == $eof } {
-               set end_1 1
-               break
-           }
-       }
-       while { [string length $line_b] == 0 || [string match "#*" $line_b] } {
-           if [ string match "#pass" $line_b ] {
-               set end_2 1
-               set diff_pass 1
-               break
-           } elseif [ string match "#..." $line_b ] {
-               if { [gets $file_b line_b] == $eof } {
-                   set end_2 1
-                   set diff_pass 1
-                   break
-               }
-                # Substitute on the reference.
-                foreach {name value} $ref_subst {
-                    regsub -- $name $line_b $value line_b
-                }
-               verbose "looking for \"^$line_b$\"" 3
-               while { ![regexp "^$line_b$" "$line_a"] } {
-                   verbose "skipping    \"$line_a\"" 3
-                   if { [gets $file_a line_a] == $eof } {
-                       set end_1 1
-                       break
-                   }
-               }
-               break
-           }
-           if { [gets $file_b line_b] == $eof } {
-               set end_2 1
-               break
-           }
-       }
-
-        if { $diff_pass } {
-            break
-        } elseif { $end_1 && $end_2 } {
-            break
-        } elseif { $end_1 } {
-            send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n"
-            verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3
-            set differences 1
-            break
-        } elseif { $end_2 } {
-            send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n"
-            verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3
-            set differences 1
-            break
-        } else {
-            # Substitute on the reference.
-            foreach {name value} $ref_subst {
-                regsub -- $name $line_b $value line_b
-            }
-            verbose "regexp \"^$line_b$\"\nline   \"$line_a\"" 3
-            if ![regexp "^$line_b$" "$line_a"] {
-               send_log "regexp_diff match failure\n"
-               send_log "regexp \"^$line_b$\"\nline   \"$line_a\"\n"
-               verbose "regexp_diff match failure\n" 3
-               set differences 1
-            }
-        }
-    }
-
-    if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } {
-       send_log "$file_1 and $file_2 are different lengths\n"
-       verbose "$file_1 and $file_2 are different lengths" 3
-       set differences 1
-    }
-
-    close $file_a
-    close $file_b
-
-    return $differences
-}
-
 proc file_contents { filename } {
     set file [open $filename r]
     set contents [read $file]
@@ -1107,7 +894,7 @@ proc run_list_test { name {opts {}} {testname {}} } {
     }
     set file $srcdir/$subdir/$name
     gas_run ${name}.s $opts ">&dump.out"
-    if { [regexp_diff "dump.out" "${file}.l" ""] } then {
+    if { [regexp_diff "dump.out" "${file}.l"] } then {
        fail $testname
        verbose "output is [file_contents "dump.out"]" 2
        return
@@ -1126,7 +913,7 @@ proc run_list_test_stdin { name {opts {}} {testname {}} } {
     }
     set file $srcdir/$subdir/$name
     gas_run_stdin ${name}.s $opts ">&dump.out"
-    if { [regexp_diff "dump.out" "${file}.l" ""] } then {
+    if { [regexp_diff "dump.out" "${file}.l"] } then {
        fail $testname
        verbose "output is [file_contents "dump.out"]" 2
        return
index e0f686291f6acf3472ccc1b58ddc3b9e65df933a..a547b7b576441b4bceda04748f02ba29ca7dc057 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-10  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2010-11-08  Thomas Schwinge  <thomas@schwinge.name>
+       * configure.host: Add stanza for *-*-gnu*.
+
 2011-02-01  Alan Modra  <amodra@gmail.com>
 
        Backport from mainline
index 3e88c27d2e9b8e5738456220e1406c1527dd5152..f2dffe67bc56b4e52dd42ad8eb19e7659e9b16a9 100644 (file)
@@ -37,6 +37,15 @@ case "${host}" in
   HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
   ;;
 
+*-*-gnu*)
+  # When creating static executables, we ought to use crt0.o instead of crt1.o,
+  # <http://www.gnu.org/software/hurd/open_issues/binutils.html#static>,
+  # but the testing infrastructure is not prepared for that.  This is not
+  # relevant for most tests, and the few remaining ones have been XFAILed.
+  HOSTING_CRT0='-dynamic-linker `${CC} --help --verbose 2>&1 | egrep "ld[^ ]*\.so" | sed -e "s,.*-dynamic-linker[      ][      ]*\(.*/ld[^ ]*\.so[^    ]*\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
+  HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
+  ;;
+
 *-*-netbsd*)
   # Different versions of NetBSD with the ELF object format use different
   # sets of start/end files.
@@ -194,7 +203,7 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
 *-*-freebsd* | *-*-kfreebsd*-gnu | *-*-dragonfly*)
   ;;
 
-*-*-linux*)
+*-*-linux* | *-*-gnu*)
   ;;
 
 *-*-netbsd*)
index baa874db2d05719b118ee426accdd630d6681743..1347290839734a9c52cf32599de510ba450479a9 100644 (file)
@@ -1,3 +1,143 @@
+2011-02-10  Alan Modra  <amodra@gmail.com>
+
+       Apply from mainline
+       2011-01-08  Nick Clifton  <nickc@redhat.com>
+       PR ld/13258
+       PR ld/13259
+       * ld-elf/textaddr2.d: Fix regexp to work with hppa64 targets.
+       * ld-elf/textaddr6.d: Fix regexp to work with hppa64 targets.
+
+       2010-12-31  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+       PR ld/12360
+       * ld-elfcomm/elfcomm.exp (test1w1): Use same check as MIPS on
+       hppa*64*-*-*.
+
+       2010-12-20  Alan Modra  <amodra@gmail.com>
+       * ld-bootstrap/bootstrap.exp: Fix misplaced comment.
+
+       2010-12-04  H.J. Lu  <hongjiu.lu@intel.com>
+       * ld-selective/selective.exp: Don't pass -fvtable-gc to GCC
+       3.4.0 or above.
+
+       2010-12-04  H.J. Lu  <hongjiu.lu@intel.com>
+       * ld-elfvers/vers.exp: Replace -export-dynamic with
+       -Wl,-export-dynamic.
+
+       2010-12-11  Alan Modra  <amodra@gmail.com>
+       * ld-elfvers/vers25a.dsym: Really include _? in match.
+
+       2010-12-10  Mike Frysinger  <vapier@gentoo.org>
+       * ld-elfvers/vers.h: New file.
+       * ld-elfvers/vers1.c: Include vers.h.  Change asm(.symver) to SYMVER().
+       * ld-elfvers/vers4.c, ld-elfvers/vers5.c, ld-elfvers/vers6.c,
+       ld-elfvers/vers7a.c, ld-elfvers/vers9.c, ld-elfvers/vers15.c,
+       ld-elfvers/vers18.c, ld-elfvers/vers21.c, ld-elfvers/vers22a.c,
+       ld-elfvers/vers23a.c, ld-elfvers/vers24a.c, ld-elfvers/vers24c.c,
+       ld-elfvers/vers27d1.c: Likewise.
+       * ld-elf/pr9676.rd: Include _? in symbol match
+       * ld-elf/pr9676.rd, ld-elf/pr9679.rd, ld-elfvers/vers1.dsym,
+       ld-elfvers/vers1.sym, ld-elfvers/vers15.dsym, ld-elfvers/vers15.sym,
+       ld-elfvers/vers16.dsym, ld-elfvers/vers16a.dsym, ld-elfvers/vers17.dsym,
+       ld-elfvers/vers18.dsym, ld-elfvers/vers18.sym, ld-elfvers/vers19.dsym,
+       ld-elfvers/vers2.dsym, ld-elfvers/vers20.dsym, ld-elfvers/vers21.dsym,
+       ld-elfvers/vers21.sym, ld-elfvers/vers22.dsym, ld-elfvers/vers22a.dsym,
+       ld-elfvers/vers22a.sym, ld-elfvers/vers22b.dsym, ld-elfvers/vers23.dsym,
+       ld-elfvers/vers23a.dsym, ld-elfvers/vers23a.sym,
+       ld-elfvers/vers23b.dsym, ld-elfvers/vers23d.dsym,
+       ld-elfvers/vers24.rd, ld-elfvers/vers25a.dsym,
+       ld-elfvers/vers26a.dsym, ld-elfvers/vers27a.dsym,
+       ld-elfvers/vers27d.dsym, ld-elfvers/vers27d.sym,
+       ld-elfvers/vers27d4.dsym, ld-elfvers/vers28b.dsym,
+       ld-elfvers/vers28c.dsym, ld-elfvers/vers29.dsym, ld-elfvers/vers3.dsym,
+       ld-elfvers/vers30.dsym, ld-elfvers/vers31.dsym, ld-elfvers/vers32a.dsym,
+       ld-elfvers/vers32b.dsym, ld-elfvers/vers4.sym, ld-elfvers/vers4a.dsym,
+       ld-elfvers/vers4a.sym, ld-elfvers/vers6.dsym, ld-elfvers/vers6.sym,
+       ld-elfvers/vers7a.dsym, ld-elfvers/vers7a.sym, ld-elfvers/vers9.dsym,
+       ld-elfvers/vers9.sym: Likewise.
+
+       2010-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+       * ld-scripts/script.exp: Remove full path from REGION_ALIAS test
+       names.
+
+       2010-11-20  Richard Sandiford  <rdsandiford@googlemail.com>
+       * lib/ld-lib.exp (regexp_diff, simple_diff): Delete.
+
+       2010-11-20  Richard Sandiford  <rdsandiford@googlemail.com>
+       * lib/ld-lib.exp (load_common_lib): New function.  Load
+       binutils-common.exp.
+       (is_elf_format, is_elf64, is_aout_format, is_pecoff_format): Delete.
+
+       2010-11-18  Alan Modra  <amodra@gmail.com>
+       * ld-elf/binutils.exp: Correct x86 gnu target match.
+       * ld-i386/i386.exp: Likewise.
+       * ld-ifunc/binutils.exp: Likewise.
+       * ld-ifunc/ifunc.exp: Likewise.
+       * ld-discard/discard.exp: Remove unnecessary line continuations.
+       * ld-elfvers/vers.exp: Likewise.  Simplify linuxaout and linuxoldld
+       test.
+       * ld-elfweak/elfweak.exp: Likewise.
+
+       2010-11-17  Andreas Schwab  <schwab@linux-m68k.org>
+       * ld-gc/pr11218-2.c: Declare
+       unresolved_detected_at_runtime_not_at_linktime.
+
+       2010-11-08  Thomas Schwinge  <thomas@schwinge.name>
+       * lib/ld-lib.exp (is_elf_format): Consider for *-*-gnu*, too.
+       * ld-discard/discard.exp: Likewise.
+       * ld-elf/binutils.exp: Likewise.
+       * ld-elf/commonpage1.d (target): Likewise.
+       * ld-elf/compress1c.d (target): Likewise.
+       * ld-elf/discard1.d (target): Likewise.
+       * ld-elf/discard2.d (target): Likewise.
+       * ld-elf/discard3.d (target): Likewise.
+       * ld-elf/dynsym1.d (target): Likewise.
+       * ld-elf/eh6.d (target): Likewise.
+       * ld-elf/elf.exp: Likewise.
+       (array_tests): Move -static tests to...
+       (array_tests_static): ... here, and handle it accordingly.
+       * ld-elf/hash.d (target): Likewise.
+       * ld-elf/header.d (target): Likewise.
+       * ld-elf/loadaddr1.d (target): Likewise.
+       * ld-elf/loadaddr2.d (target): Likewise.
+       * ld-elf/loadaddr3a.d (target): Likewise.
+       * ld-elf/loadaddr3b.d (target): Likewise.
+       * ld-elf/local1.d (target): Likewise.
+       * ld-elf/maxpage1.d (target): Likewise.
+       * ld-elf/maxpage2.d (target): Likewise.
+       * ld-elf/maxpage3a.d (target): Likewise.
+       * ld-elf/multibss1.d (target): Likewise.
+       * ld-elf/noload-2.d (target): Likewise.
+       * ld-elf/seg.d (target): Likewise.
+       * ld-elf/textaddr1.d (target): Likewise.
+       * ld-elf/textaddr2.d (target): Likewise.
+       * ld-elf/textaddr3.d (target): Likewise.
+       * ld-elf/textaddr4.d (target): Likewise.
+       * ld-elf/textaddr5.d (target): Likewise.
+       * ld-elf/textaddr6.d (target): Likewise.
+       * ld-elf/textaddr7.d (target): Likewise.
+       * ld-elf/tls_common.exp: Likewise.
+       * ld-elf/unknown2.d (target): Likewise.
+       * ld-elfvers/vers.exp: Likewise.
+       * ld-elfvsb/elfvsb.exp: Likewise.
+       * ld-elfweak/elfweak.exp: Likewise.
+       (setup_xfail_gnu_hurd): New function.  Use it where appropriate.
+       * ld-gc/abi-note.d (target): Likewise.
+       * ld-gc/gc.exp: Likewise.
+       * ld-gc/pr11218.d (target): Likewise.
+       * ld-gc/start.d (target): Likewise.
+       * ld-i386/i386.exp: Likewise.
+       * ld-ifunc/binutils.exp: Likewise.
+       * ld-ifunc/ifunc.exp: Likewise.
+       * ld-linkonce/linkonce.exp: Likewise.
+       * ld-linkonce/zeroehl32.d (target): Likewise.
+       * ld-pie/pie.exp: Likewise.
+       * ld-scripts/phdrs2.exp: Likewise.
+       * ld-scripts/rgn-at5.d (target): Likewise.
+       * ld-shared/shared.exp: Likewise.
+       * ld-undefined/entry-3.d (target): Likewise.
+       * ld-undefined/entry-4.d (target): Likewise.
+       * ld-undefined/weak-undef.exp: Likewise.
+
 2011-02-09  Alan Modra  <amodra@gmail.com>
 
        * ld-elfvsb/elfvsb.exp: Don't run any non-PIC tests on powerpc*-linux.
index 74b6a5ca6f8aa1daafe345155d5d4f71231b6bc5..d0563deb89e79b255af26787b9eec1ce9f792fd4 100644 (file)
@@ -1,6 +1,6 @@
 # Expect script for LD Bootstrap Tests
 #   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2004,
-#   2005, 2006, 2007, 2009  Free Software Foundation, Inc.
+#   2005, 2006, 2007, 2009, 2010  Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -77,14 +77,14 @@ foreach flags {"" "strip" "--static" "--traditional-format"
     }
 
     # Plugin support requires linking with a dynamic library which
-    # means that these
+    # means that these tests will fail.
     if { $flags == "--static" && $plugins == "yes" } then {
        untested $testname
        continue
     }
 
     # If we only have a shared libbfd, we probably can't run the
-    # --static test.will fail.
+    # --static test.
     if { $flags == "--static" && ! [string match "*libbfd.a*" $BFDLIB] } then {
        untested $testname
        continue
index deb5dfdefb38e80810cda8a22b5a5c826b90a23b..f1038cdde068c60f02107d2efd042ea7fce42fa3 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ld discard tests
-#   Copyright 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+#   Copyright 2001, 2002, 2005, 2007, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
 # Test for ELF here, so we don't have to qualify on ELF specifically
 # in every .d-file.
 
-if { ![istarget *-*-linux*] \
-     && ![istarget *-*-gnu] \
-     && ![istarget hppa*64*-*-hpux*] \
+if { ![istarget *-*-linux*]
+     && ![istarget *-*-gnu*]
+     && ![istarget hppa*64*-*-hpux*]
      && ![istarget *-*-elf] } {
     return
 }
 
-if { [istarget *-*-linux*aout*] \
+if { [istarget *-*-linux*aout*]
      || [istarget *-*-linux*oldld*] } {
     return
 }
index 422c5d71ba923ea3e82252048755815a8f29dbc1..6f881f349035552725e1530fdb862ec5a75962d7 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for binutils tests
-#   Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+#   Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -23,8 +23,8 @@
 
 # Make sure that binutils can correctly handle ld output in ELF.
 
-# Run on Linux only.
-if { ![istarget *-*-linux*] } {
+if { ![istarget *-*-linux*]
+     && ![istarget *-*-gnu*]} {
     return
 }
 
@@ -109,7 +109,8 @@ binutils_test strip "-z relro -shared" relro1
 binutils_test objcopy "-z relro" relro1
 binutils_test objcopy "-z relro -shared" relro1
 if { ([istarget "i?86-*-elf*"]         
-      || ([istarget "i?86-*-linux*"]
+      || (([istarget "i?86-*-linux*"]
+          || [istarget "i?86-*-gnu*"])
          && ![istarget "*-*-*aout*"]
          && ![istarget "*-*-*oldld*"])
       || [istarget "x86_64-*-linux*"]
index 76dc0565b3420a77741784f5cd62c30994df716b..2b175740c52560006c3c953c65582fd96f20f3e3 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -z max-page-size=0x200000 -z common-page-size=0x100000
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   LOAD+.*0x200000
index 50426942af64c7cc86f5980b1600cece2923bd70..90abe0ff0721bc924cf7f7445d3ca8fd99697cec 100644 (file)
@@ -2,7 +2,7 @@
 #as: --compress-debug-sections
 #ld: -shared
 #readelf: -S --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #failif
 #...
index b80fbf02dbdbf675f274ec0a448b7f97b37ed5bb..99de88eaf88e1ecca7b5d7e2ab88965f9bed29db 100644 (file)
@@ -1,7 +1,7 @@
 #source: discard1.s
 #ld: -r -T discard.ld
 #readelf: -r
-#target: x86_64-*-linux-gnu i?86-*-linux-gnu
+#target: x86_64-*-linux-gnu i?86-*-linux-gnu i?86-*-gnu*
 
 Relocation section '.rel.*.debug_info' at offset 0x[0-9a-z]+ contains 1 entries:
 [ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
index 65a3abe29ba161f71f8f9ff3f09b52574c89f094..df106199408aedf7de65049ac359a7e39f9d4533 100644 (file)
@@ -1,7 +1,7 @@
 #source: discard2.s
 #ld: -r -T discard.ld
 #readelf: -r
-#target: x86_64-*-linux-gnu i?86-*-linux-gnu
+#target: x86_64-*-linux-gnu i?86-*-linux-gnu i?86-*-gnu*
 
 Relocation section '.rel.*.debug_info' at offset 0x[0-9a-z]+ contains 1 entries:
 [ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
index 07962b5374884df3a3762a40f903e8afdb43503b..693488247b96cfcc85628784751e2cbecfbf82fc 100644 (file)
@@ -2,7 +2,7 @@
 #source: discard2.s
 #ld: -r -T discard.ld
 #readelf: -r
-#target: x86_64-*-linux-gnu i?86-*-linux-gnu
+#target: x86_64-*-linux-gnu i?86-*-linux-gnu i?86-*-gnu*
 
 Relocation section '.rel.*.debug_info' at offset 0x[0-9a-z]+ contains 2 entries:
 [ \t]+Offset[ \t]+Info[ \t]+Type[ \t]+Sym.*
index 88037ef7bae5188da626d4ab58fe8b8727d73caf..b354aae2f9a402632725265022f239c62c8757f7 100644 (file)
@@ -1,7 +1,7 @@
 #source: empty.s
 #ld: -shared
 #readelf: --dyn-syms
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
  +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +[1-9] _start
index 75eb54b9d52e4e52adf025b76260baa50913ad60..76be60585bf17bd4aa7d364c0b78110b10c09c7e 100644 (file)
@@ -1,7 +1,7 @@
 #source: eh6.s
 #ld: --gc-sections -shared
 #readelf: -wf
-#target: x86_64-*-linux-gnu i?86-*-linux-gnu
+#target: x86_64-*-linux-gnu i?86-*-linux-gnu i?86-*-gnu*
 
 Contents of the .eh_frame section:
 
index 1e1f738efefc9882829a38607819b4861ee471d6..cff216048d032dbcc1746efa5b36c3094c76dc02 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various ELF tests.
-#   Copyright 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -41,7 +41,8 @@ foreach t $test_list {
     run_dump_test [file rootname $t]
 }
 
-if { [istarget *-*-linux*] } {
+if { [istarget *-*-linux*]
+     || [istarget *-*-gnu*] } {
     run_ld_link_tests {
        {"Weak symbols in dynamic objects 1 (support)"
            "-shared" "" {weak-dyn-1a.s}
@@ -71,14 +72,25 @@ if ![isnative] {
 
 set array_tests {
     {"preinit array" "" "" {preinit.c} "preinit" "preinit.out"}
-    {"static preinit array" "-static" "" {preinit.c} "preinit" "preinit.out"}
     {"init array" "" "" {init.c} "init" "init.out"}
-    {"static init array" "-static" "" {init.c} "init" "init.out"}
     {"fini array" "" "" {fini.c} "fini" "fini.out"}
+}
+set array_tests_static {
+    {"static preinit array" "-static" "" {preinit.c} "preinit" "preinit.out"}
+    {"static init array" "-static" "" {init.c} "init" "init.out"}
     {"static fini array" "-static" "" {fini.c} "fini" "fini.out"}
 }
 
 # NetBSD ELF systems do not currently support the .*_array sections.
-run_ld_link_exec_tests [list "*-*-netbsdelf*"] $array_tests
+set xfails [list "*-*-netbsdelf*"]
+run_ld_link_exec_tests $xfails $array_tests
+# Be cautious to not XFAIL for *-*-linux-gnu*, *-*-kfreebsd-gnu*, etc.
+switch -regexp $target_triplet {
+    ^\[^-\]*-\[^-\]*-gnu.*$ {
+       # <http://www.gnu.org/software/hurd/open_issues/binutils.html#static>
+       lappend xfails "*-*-*"
+    }
+}
+run_ld_link_exec_tests $xfails $array_tests_static
 
 catch "exec rm -f tmpdir/preinit tmpdir/init tmpdir/fini" status
index 9bcd9a974a523db0bb0c5d1314f887b2cdddf55f..473cd4d7b877a7d7c52573c4439ad12e3a81a4fc 100644 (file)
@@ -1,7 +1,7 @@
 #source: start.s
 #readelf: -d -s -D
 #ld: -shared --hash-style=gnu
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 #notarget: mips*-*-*
 
 #...
index d4388323ddda59f7bc8ffb1f65d4dc2656333cf6..be3722d957f10f09ce5a4fd64c7113991b2c1401 100644 (file)
@@ -1,4 +1,4 @@
-# target: *-*-linux*  *-*-vxworks
+# target: *-*-linux* *-*-gnu* *-*-vxworks
 # ld: -T header.t -z max-page-size=0x100
 # objdump: -hpw
 
index 2d3469be2538cb266746966a900b8ba6fbce87f0..0fd96a78ea3ace10ad158e9398b540fa742ca468 100644 (file)
@@ -1,7 +1,7 @@
 #source: loadaddr.s
 #ld: -T loadaddr1.t -T loadaddr.t -z max-page-size=0x200000
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
index e447e384c371f8722081e41cb3871bf7c5a0d534..5825fe8494ce002db7acc57a942a975535a35b24 100644 (file)
@@ -1,7 +1,7 @@
 #source: loadaddr.s
 #ld: -T loadaddr2.t -T loadaddr.t -z max-page-size=0x200000
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   LOAD +0x000000 0xf*80000000 0xf*80000000 0x100050 0x100050 RWE 0x200000
index b2ace667a9298e4cb9da48b966266b8ba2e6dfa1..10cb9a588f477b994ad8880987f6370f1bd78e47 100644 (file)
@@ -1,7 +1,7 @@
 #source: loadaddr.s
 #ld: -T loadaddr3.t -z max-page-size=0x200000
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   LOAD +0x000000 0x0*00000000 0x0*00000000 0x0*0110 0x0*0110 R E 0x.*
index af7e6e4e07ea064074812e792897e3d005f2b453..63efa71c1334d8ccda0c7d4bd5c35dcd58abb80c 100644 (file)
@@ -1,7 +1,7 @@
 #source: loadaddr.s
 #ld: -T loadaddr3.t -z max-page-size=0x200000
 #objdump: -t
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
 0+0000100 l    d  .text        0+0000000 .text
index 5957d8f4b6323e9ac19fd657ce1569717aaa41aa..3025d419716a6a7d98659539ee1feb5ec1a39482 100644 (file)
@@ -1,6 +1,6 @@
 #ld: -shared --version-script local1.map
 #readelf: -s --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
     .*: [0-9a-f]* +[0-9a-f]+ +OBJECT +LOCAL +DEFAULT +[0-9] +foo
index 57acda090a95dcd5dab88965a2acc7d569418204..f7762573998695eb11b2341dd84f24e41be50394 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -z max-page-size=0x200000
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   LOAD+.*0x200000
index 7fe9379884606755a756fb0ff6e324970fb32230..7d732eb80ee50edd0b1fad42aba9cb20d1f1c778 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -z max-page-size=0x100000
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   LOAD+.*0x100000
index 0e46b6bb3e8c13a781075fe2864cb1358faf865d..7d6f2d8ab99fe534ffb2c2090f2ef676675c2cb7 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -z max-page-size=0x10000000 -T maxpage3.t
 #readelf: -lS --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   \[[ 0-9]+\] \.data[ \t]+PROGBITS[ \t]+0*10000000[ \t]+[ \t0-9a-f]+WA?.*
index a6fd9b3ed2b4c282cdba0176dddd10a827ab8ec3..89b94adfa1ee14f8020c0c544924c89cfdd0107c 100644 (file)
@@ -1,7 +1,7 @@
 #source: multibss1.s
 #ld: -e 0
 #readelf: -l --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 #xfail: hppa64-*-*
 # hppa64 default script add 16 bytes at start of .data giving 0x500010 p_memsz
 
index 633bf4563830d3cb239b86ca691559b84b698f33..0e25d9beef6d658c7776f6ca4cd88d974616ba89 100644 (file)
@@ -1,7 +1,7 @@
 #source: noload-1.s
 #ld: -T noload-1.t -z max-page-size=0x200000
 #readelf: -Sl --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
  +LOAD +0x200000 +0x0+ +0x0+ +0x0+ +0x0+1 +RW +0x200000
index 44a11cea2b7082f30efc91c03b882bdefc31c3a5..2d832dbe1e911a9384e38f4c0706607fd775a20d 100644 (file)
@@ -1,5 +1,5 @@
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +_?foo
 #...
index 44a11cea2b7082f30efc91c03b882bdefc31c3a5..2d832dbe1e911a9384e38f4c0706607fd775a20d 100644 (file)
@@ -1,5 +1,5 @@
 Symbol table '\.dynsym' contains [0-9]+ entries:
  +Num: +Value +Size Type +Bind +Vis +Ndx Name
 #...
- +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +foo
+ +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +DEFAULT +[0-9]+ +_?foo
 #...
index d9436aeb776d216805a2feef5fb903fbcbe1fded..2255195dab18efaff3edad1fdbd5b8fb7b8acb7f 100644 (file)
@@ -1,4 +1,4 @@
-#target: *-*-linux* *-*-vxworks
+#target: *-*-linux* *-*-gnu* *-*-vxworks
 #source: seg.s
 #ld: -T seg.t -z max-page-size=0x1000
 #readelf: -l --wide
index f7a3ad953e197e62de725526130bc0498c35ebe7..e1d6731a03d863e26114b5770930724b9ff2c92b 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -Ttext-segment 0x7000000 -z max-page-size=0x200000
 #readelf: -l --wide
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 
 #...
   LOAD +0x0+ 0x0*7000000 0x0*7000000 0x0*[0-9a-f][0-9a-f][0-9a-f] 0x0*[0-9a-f][0-9a-f][0-9a-f] R E 0x200000
index 9d1b0e51b13b4e055b9d4560dade1c26d6fd910f..bcd3658bb75327dbe0075a787e4c8a1fcaf7c885 100644 (file)
@@ -1,8 +1,8 @@
 #source: maxpage1.s
 #ld: -shared -Ttext-segment 0x7000000 -z max-page-size=0x200000
 #readelf: -l --wide
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 
 #...
-  LOAD +0x0+ 0x0*7000000 0x0*7000000 0x0*[0-9a-f][0-9a-f][0-9a-f] 0x0*[0-9a-f][0-9a-f][0-9a-f] R E 0x200000
+  LOAD +0x0+ 0x0*7000000 0x0*7000000 0x0*[0-9a-f]+ 0x0*[0-9a-f]+ R[ W]E 0x200000
 #pass
index d533e242bd003dd6ced37c7b67f7a95b4c66d395..29ed4984b4a6598674ca6dc4deed72f66b0f83fd 100644 (file)
@@ -1,4 +1,4 @@
 #source: maxpage1.s
 #ld: -Ttext-segment 0x10000 -z max-page-size=0x200000
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 #warning: .*address of `text-segment' isn't multiple of maximum page size
index bfd7630e47b5d9094a85701b25e80a72d4413fbf..16df9a8ab1e2f16912b88d9dd09196d9a3e79959 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -z max-page-size=0x10000 -Ttext-segment 0x10000
 #readelf: -l --wide
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 
 #...
   LOAD +0x0+ 0x0*10000 0x0*10000 0x0*[0-9a-f][0-9a-f][0-9a-f] 0x0*[0-9a-f][0-9a-f][0-9a-f] R E 0x10000
index 5fe41d0aa9dfdb76e704cb545ea7fda2ddeb9391..41d00c5af42c0fed7c4a7b61977e89163a622c5e 100644 (file)
@@ -1,4 +1,4 @@
 #source: maxpage1.s
 #ld: -shared -z max-page-size=0x200000 -Ttext-segment 0x10000
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 #warning: .*address of `text-segment' isn't multiple of maximum page size
index b3b9f847328c4a8b460aede69f9ddec6ae649e58..584784b2d5911300392ed7616730488e7dbee8fe 100644 (file)
@@ -1,8 +1,8 @@
 #source: maxpage1.s
 #ld: -shared -z max-page-size=0x10000 -Ttext-segment 0x10000
 #readelf: -l --wide
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 
 #...
-  LOAD +0x0+ 0x0*10000 0x0*10000 0x0*[0-9a-f][0-9a-f][0-9a-f] 0x0*[0-9a-f][0-9a-f][0-9a-f] R E 0x10000
+  LOAD +0x0+ 0x0*10000 0x0*10000 0x0*[0-9a-f]+ 0x0*[0-9a-f]+ R[ W]E 0x10000
 #pass
index 54a571f5839fc12d379a8344ce38ed80296b9ef7..b4237db4f1c601848a5d820bf01f4c46aa5615f5 100644 (file)
@@ -1,7 +1,7 @@
 #source: maxpage1.s
 #ld: -n -z max-page-size=0x200000 -Ttext-segment 0x10000
 #readelf: -l --wide
-#target: *-*-linux-gnu
+#target: *-*-linux-gnu *-*-gnu*
 
 #...
   LOAD .*
index 66a550ccdf710d965ba083b4d769f06c3dec8b78..77dca2c02e48f76c10f7a43b35d309d049564edb 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for .tls_common tests
-#   Copyright 2006, 2007 Free Software Foundation, Inc.
+#   Copyright 2006, 2007, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -23,8 +23,8 @@
 
 # Make sure that binutils can correctly handle ld output in ELF.
 
-# Run on Linux only.
-if { ![istarget *-*-linux*] } {
+if { ![istarget *-*-linux*]
+     && ![istarget *-*-gnu*] } {
     return
 }
 
index 467d5d346b5f772a3fe20b49921e9e5d20bc463d..8d6cdeef58bd8ad94b66e5100dd995cd2d218131 100644 (file)
@@ -1,7 +1,7 @@
 #source: unknown2.s
 #ld: -shared
 #readelf: -S
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
   \[[ 0-9]+\] \.note.foo[ \t]+NOTE[ \t]+.*
index e45c6b199bf0b8e78f09ca27759f996fcddf23ae..572931b948943270b603536fa067305787ad2732 100644 (file)
@@ -209,8 +209,8 @@ if { [ld_simple_link $ld tmpdir/common1.o $options] } {
 }
 
 # This test fails on MIPS because the backend sets type_change_ok.
-# The size change warning is suppressed.
-if {[istarget mips*-*-*]} {
+# The size change warning is suppressed.  Same on hppa64.
+if {[istarget mips*-*-*] || [istarget hppa*64*-*-*]} {
     if { ![regexp "Warning: alignment (\[0-9\]+) of symbol \`_?foo1\' in tmpdir/common1b.o is smaller than 64 in tmpdir/common1a.o" $link_output] } {
         fail $test1w1
     } else {
index c4228aded84eb3feece0981dc55dab3159b88594..d43c12e12e9e3e4097877f85d4568f4637a787d9 100644 (file)
@@ -29,34 +29,34 @@ if ![isnative] then {return}
 # This test can only be run on a couple of ELF platforms.
 # Square bracket expressions seem to confuse istarget.
 # This is similar to the test that is used in ld-shared, BTW.
-if { ![istarget hppa*64*-*-hpux*] \
-     && ![istarget hppa*-*-linux*] \
-     && ![istarget i?86-*-sysv4*] \
-     && ![istarget i?86-*-unixware] \
-     && ![istarget i?86-*-elf*] \
-     && ![istarget i?86-*-linux*] \
-     && ![istarget ia64-*-elf*] \
-     && ![istarget ia64-*-linux*] \
-     && ![istarget m68k-*-linux*] \
-     && ![istarget mips*-*-irix5*] \
-     && ![istarget powerpc*-*-elf*] \
-     && ![istarget powerpc*-*-linux*] \
-     && ![istarget powerpc*-*-sysv4*] \
-     && ![istarget sparc*-*-elf] \
-     && ![istarget sparc*-*-solaris2*] \
-     && ![istarget sparc*-*-linux*] \
-     && ![istarget arm*-*-linux*] \
-     && ![istarget mips*-*-linux*] \
-     && ![istarget alpha*-*-linux*] \
-     && ![istarget s390*-*-linux*] \
-     && ![istarget sh\[34\]*-*-linux*] \
+if { ![istarget hppa*64*-*-hpux*]
+     && ![istarget hppa*-*-linux*]
+     && ![istarget i?86-*-sysv4*]
+     && ![istarget i?86-*-unixware]
+     && ![istarget i?86-*-elf*]
+     && ![istarget i?86-*-linux*]
+     && ![istarget i?86-*-gnu*]
+     && ![istarget ia64-*-elf*]
+     && ![istarget ia64-*-linux*]
+     && ![istarget m68k-*-linux*]
+     && ![istarget mips*-*-irix5*]
+     && ![istarget powerpc*-*-elf*]
+     && ![istarget powerpc*-*-linux*]
+     && ![istarget powerpc*-*-sysv4*]
+     && ![istarget sparc*-*-elf]
+     && ![istarget sparc*-*-solaris2*]
+     && ![istarget sparc*-*-linux*]
+     && ![istarget arm*-*-linux*]
+     && ![istarget mips*-*-linux*]
+     && ![istarget alpha*-*-linux*]
+     && ![istarget s390*-*-linux*]
+     && ![istarget sh\[34\]*-*-linux*]
      && ![istarget x86_64-*-linux*] } {
     return
 }
 
-if { [istarget i?86-*-linux*aout*] \
-     || [istarget i?86-*-linux*oldld*] \
-     || [istarget m68k-*-linux*aout*] } {
+if { [istarget *-*-linux*aout*]
+     || [istarget *-*-linux*oldld*] } {
     return
 }
 
@@ -83,9 +83,9 @@ if [istarget mips*-*-*] {
     catch "exec $CC $picflag" exec_output
     send_log "$exec_output\n"
     verbose "--" "$exec_output"
-    if { [string match "*illegal option*" $exec_output] \
-        || [string match "*option ignored*" $exec_output] \
-        || [string match "*unrecognized option*" $exec_output] \
+    if { [string match "*illegal option*" $exec_output]
+        || [string match "*option ignored*" $exec_output]
+        || [string match "*unrecognized option*" $exec_output]
         || [string match "*passed to ld*" $exec_output] } {
        if [istarget *-*-sunos4*] {
            set picflag "-pic"
@@ -803,11 +803,11 @@ build_exec "vers3" vers3.c vers3 "" vers1.so vers3.ver vers3.dsym ""
 setup_xfail "mips*-*-*"
 build_exec "vers4" vers4.c vers4 "" "" "" "" vers4.sym
 
-build_exec "vers4a" vers4.c vers4a "-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym
+build_exec "vers4a" vers4.c vers4a "-Wl,-export-dynamic" "" vers4a.ver vers4a.dsym vers4a.sym
 
 # Verify that --no-export-dynamic undoes the effect of --export-dynamic.
 setup_xfail "mips*-*-*"
-build_exec "vers4b" vers4.c vers4b "-export-dynamic -Wl,--no-export-dynamic" "" "" "" vers4.sym
+build_exec "vers4b" vers4.c vers4b "-Wl,-export-dynamic -Wl,--no-export-dynamic" "" "" "" vers4.sym
 
 
 #
@@ -848,7 +848,7 @@ build_vers_lib_pic "vers8" vers1.c vers8 vers8.map "" vers8.ver vers1.dsym vers1
 # This test tries to make sure that version references to versioned symbols
 # don't collide with default definitions with the same symbol.
 #
-build_exec "vers9" vers9.c vers9 "-export-dynamic" "" vers9.ver vers9.dsym vers9.sym
+build_exec "vers9" vers9.c vers9 "-Wl,-export-dynamic" "" vers9.ver vers9.dsym vers9.sym
 
 
 #
index c27bc3bce7e74dfe5092564b0c6c5364a5b932f9..86e2bd2ba16157a3014fd822055c185a5eee800c 100644 (file)
@@ -3,6 +3,8 @@
  * a bunch of definitions of the same symbol, and we can theoretically
  * then link applications against varying sets of these.
  */
+#include "vers.h"
+
 const char * show_bar1 = "asdf";
 const char * show_bar2 = "asdf";
 
@@ -47,10 +49,10 @@ hide_new_foo()
 
 }
 
-__asm__(".symver hide_original_foo,show_foo@");
-__asm__(".symver hide_old_foo,show_foo@VERS_1.1");
-__asm__(".symver hide_old_foo1,show_foo@VERS_1.2");
-__asm__(".symver hide_new_foo,show_foo@@VERS_2.0");
+SYMVER(hide_original_foo, show_foo@);
+SYMVER(hide_old_foo, show_foo@VERS_1.1);
+SYMVER(hide_old_foo1, show_foo@VERS_1.2);
+SYMVER(hide_new_foo, show_foo@@VERS_2.0);
 
 
 
@@ -63,7 +65,7 @@ hide_new_bogus_foo()
        return 1000+bar();
 
 }
-__asm__(".symver hide_new_bogus_foo,show_foo@VERS_2.2");
+SYMVER(hide_new_bogus_foo, show_foo@VERS_2.2);
 #endif
 
 
@@ -81,8 +83,8 @@ xyzzz()
   bar33();
 }
 
-__asm__(".symver new2_foo,fooVERS_2.0");
-__asm__(".symver bar33,bar@@VERS_2.0");
+SYMVER(new2_foo, fooVERS_2.0);
+SYMVER(bar33, bar@@VERS_2.0);
 #endif
 
 #ifdef DO_TEST12
@@ -97,5 +99,5 @@ xyzzz()
   bar33();
 }
 
-__asm__(".symver bar33,bar@@VERS_2.0");
+SYMVER(bar33, bar@@VERS_2.0);
 #endif
index d33ab2007de914a5643f89ba2471bdd252cd80d8..9d1975288c7cd4bc62b831412b800dddbb019597 100644 (file)
@@ -1,9 +1,9 @@
 0+ g +DO \*ABS\*       0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*       0+ +VERS_1\.2 +VERS_1\.2
 0+ g +DO \*ABS\*       0+ +VERS_2\.0 +VERS_2\.0
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DO (\.s?data|\*ABS\*)     [0-9a-f]+ +VERS_2\.0 +show_bar1
-[0-9a-f]+ g +DO (\.s?data|\*ABS\*)     [0-9a-f]+ +VERS_2\.0 +show_bar2
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DO (\.s?data|\*ABS\*)     [0-9a-f]+ +VERS_2\.0 +_?show_bar1
+[0-9a-f]+ g +DO (\.s?data|\*ABS\*)     [0-9a-f]+ +VERS_2\.0 +_?show_bar2
index ed589e83d705e148a6b50b83ac60fff27daa3f32..f2bb9db2a4eaace89066c22fd6e7d71d481214b6 100644 (file)
@@ -1,4 +1,4 @@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.1
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.2
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@@VERS_2\.0
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0
index 4e22cac092aac1bacba517f2f95d8be649993bd0..2457d29755596ee0a7abb79aa7024acdfe7d739f 100644 (file)
@@ -3,6 +3,7 @@
  * that we always get the right one.
  */
 #include <stdio.h>
+#include "vers.h"
 
 int
 foo_1()
@@ -31,6 +32,6 @@ main()
   return 0;
 }
 
-__asm__(".symver foo_1,show_foo@");
-__asm__(".symver foo_2,show_foo@VERS_1.1");
-__asm__(".symver foo_3,show_foo@@VERS_1.2");
+SYMVER(foo_1, show_foo@);
+SYMVER(foo_2, show_foo@VERS_1.1);
+SYMVER(foo_3, show_foo@@VERS_1.2);
index fc4c9962ea5ba54a1af63cb0dc812f53d99dd516..750c35832ab979971617be7de472089c753d0054 100644 (file)
@@ -1,5 +1,5 @@
 0+ g +DO \*ABS\*       0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*       0+ +VERS_1\.2 +VERS_1\.2
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?_?show_foo
index ba9f83e19128de20075c555552d163fedd0451f0..a642c9dbabcec6f9610383ed39a3ee8c44698d35 100644 (file)
@@ -1,3 +1,3 @@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.1
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@@VERS_1\.2
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_1\.2
index 6733ece6deff0463c304997f0e7e0a2ef54f8fdc..8ee491879249dd2a24e01af9753c42916142d9e8 100644 (file)
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+( +Base +)? (0x[0-9a-f]+ )?show_bar
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+( +Base +)? (0x[0-9a-f]+ )?_?show_bar
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +(0x[0-9a-f]+ )?_?show_foo
index aaca9f5e3323c3a228a012a4a35f485bd0e1eee7..c38d71aea9e2a795eee1433d5e6453677f420e8c 100644 (file)
@@ -1,3 +1,3 @@
 [0-9a-f]+ g +DO (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.1 +VERS_1\.1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.1 +(0x[0-9a-f]+ )?show_bar
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +Base +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.1 +(0x[0-9a-f]+ )?_?show_bar
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +Base +(0x[0-9a-f]+ )?_?show_foo
index 98106593c9f2477980c9a1276af34e9cc3f898c2..4cbb334dc0d66b9ad58dd83691170f5db24036d6 100644 (file)
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*       0+ +VERS_2\.0 +VERS_2\.0
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
index 25dcc25999c5f502f53019a1137f293b829d4de9..9965b88a02954172373ff151044ec17b26712de9 100644 (file)
@@ -1,3 +1,5 @@
+#include "vers.h"
+
 int
 bar ()
 {
@@ -36,7 +38,7 @@ hide_new_foo ()
   return 1000 + bar ();
 }
 
-__asm__(".symver hide_original_foo,show_foo@");
-__asm__(".symver hide_old_foo,show_foo@VERS_1.1");
-__asm__(".symver hide_old_foo1,show_foo@VERS_1.2");
-__asm__(".symver hide_new_foo,show_foo@@VERS_2.0");
+SYMVER(hide_original_foo, show_foo@);
+SYMVER(hide_old_foo, show_foo@VERS_1.1);
+SYMVER(hide_old_foo1, show_foo@VERS_1.2);
+SYMVER(hide_new_foo, show_foo@@VERS_2.0);
index 49bd7b2b356c37f8053bbe5c1244c3019a539ba0..38071cb456db55df6b524eea16b8f132a6c59377 100644 (file)
@@ -1,7 +1,7 @@
 0+ g +DO \*ABS\*       0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*       0+ +VERS_1\.2 +VERS_1\.2
 0+ g +DO \*ABS\*       0+ +VERS_2\.0 +VERS_2\.0
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ \(Base\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ \(VERS_1\.2\) +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +w +DF (\.text|\.opd|\*ABS\*)        [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
index bcc88820da779ce994c299b5b153dce6531c4f99..0b1183ccfd888888ed13d127ecd34325b2402f3e 100644 (file)
@@ -1,4 +1,4 @@
-[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@
-[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.1
-[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@VERS_1\.2
-[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?show_foo@@VERS_2\.0
+[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@
+[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1
+[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2
+[0-9a-f]+ +w +F \.(text|opd)   [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0
index 7396deeca5f691963c0db54f486014b7157eb458..a77f94901277f8aa7aa1394317b0cd46d3869498 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
index 63f15db45f5745aa41ff922a41b9367e1d8e1bc2..30ba91b82b492910a5893bcdf5424312176eb4c1 100644 (file)
@@ -1,3 +1,3 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
 0+ g +DO \*ABS\*       0+ +VERS_XXX_1\.1 VERS_XXX_1\.1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_XXX_1\.1 (0x[0-9a-f]+ )?show_xyzzy
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_XXX_1\.1 (0x[0-9a-f]+ )?_?show_xyzzy
index 559170c1b0c8ee0f34dd9426aa1416b9d4c62a31..fc13955b8d7faf28af5e02ad6526b13655a119e1 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS_1\.1[    ]+VERS_1\.1
-[0-9a-f]+[     ]+g[    ]+DO[   ]+\.s?bss[      ]+[0-9a-f]+[    ]+VERS_1\.1[    ]+show_foo
+[0-9a-f]+[     ]+g[    ]+DO[   ]+\.s?bss[      ]+[0-9a-f]+[    ]+VERS_1\.1[    ]+_?show_foo
index 2879c7f0e3d94c7c06688908c59ededfb4338fb0..3a75b48add1707214f785ca179dcdcda389420b9 100644 (file)
@@ -1,7 +1,9 @@
-__asm__(".symver _old_foo,foo@VERS.0");
-__asm__(".symver _old_bar,bar@VERS.0");
-__asm__(".symver _old_foobar,foobar@VERS.0");
-__asm__(".weak  _old_bar");
+#include "vers.h"
+
+SYMVER(_old_foo, foo@VERS.0);
+SYMVER(_old_bar, bar@VERS.0);
+SYMVER(_old_foobar, foobar@VERS.0);
+__asm__(".weak " SYMPFX(_old_bar));
 
 int
 bar () 
index 4cb21882c2582e3b27c300fbccd8c22bab31dbd6..7800a0c34992509017816b41c4c78d7af5d5328d 100644 (file)
@@ -1,4 +1,4 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+w[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+|)[       ]*bar
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+|)[       ]*foo
-[0-9a-f]+[     ]+g[    ]+DO[   ]+\.s?data[     ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+foobar
+[0-9a-f]+[     ]+w[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+|)[       ]*_?bar
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+|)[       ]*_?foo
+[0-9a-f]+[     ]+g[    ]+DO[   ]+\.s?data[     ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+_?foobar
index e7de74f4872fa4d66cc0f6d7091465f242007f0b..e2b2038e321cda4ea797965dc3006efbb2382102 100644 (file)
@@ -1,3 +1,3 @@
-[0-9a-f]+[     ]+g[    ]+O[    ]+\.s?data[     ]+[0-9a-f]+ (0x[0-9a-f]+ )?foobar@VERS\.0
-[0-9a-f]+[     ]+w[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?bar@VERS\.0
-[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?foo@VERS\.0
+[0-9a-f]+[     ]+g[    ]+O[    ]+\.s?data[     ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foobar@VERS\.0
+[0-9a-f]+[     ]+w[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS\.0
+[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0
index 5dfa465b90dc88e7cce2ee57621a43001846cfcc..db2aeec4bc329c959ef025b24d0ef9c0f03f3921 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?bar
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?bar
index 288c82093e31f778535e267b7e4c2d74d2042752..bc5777bb83c50bc1bdf79881c2fe87e38be066f4 100644 (file)
@@ -1,4 +1,6 @@
-__asm__(".symver _old_bar,bar@VERS.0");
+#include "vers.h"
+
+SYMVER(_old_bar, bar@VERS.0);
 
 void
 _old_bar () 
index af06123386693a554835214925024ee7463f72b5..0c8d0278279f46ea44a7b9fc7662f7762d913d0a 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+ )?bar
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+ )?_?bar
index ff0770875327d32ec751fef8bd544291004febc1..c3f4150ccaa4797060a2cddd1b7041f5aa182cac 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?bar@VERS.0
+[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0
index 88c31b303f16142b9e65ba10e1efe244a2d44844..47f0606a81b929579e1cd394644e846998415228 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?bar
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?bar
index 8c85a4ae9f540b931c924fd4314a3289aa7c9238..dfd6a3321ad051ba5311aa99c1be05bf98a7a892 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?foo
index 250d6f9eefae05181e7ccea8bda0f5a7c1a3be0f..13c8edd6e3506c7170fb623061f69c93b02ee505 100644 (file)
@@ -1,4 +1,6 @@
-__asm__(".symver _old_bar,bar@VERS.0");
+#include "vers.h"
+
+SYMVER(_old_bar, bar@VERS.0);
 
 void
 _old_bar (void) 
index 4450665ff923673f2702a4f3d5c812eda984ba8d..04385b002d4f0201a4da8b948047bff309c89634 100644 (file)
@@ -1,3 +1,3 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+ )?bar
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+ )?_?bar
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?foo
index ff0770875327d32ec751fef8bd544291004febc1..c3f4150ccaa4797060a2cddd1b7041f5aa182cac 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?bar@VERS.0
+[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0
index 88c31b303f16142b9e65ba10e1efe244a2d44844..47f0606a81b929579e1cd394644e846998415228 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?bar
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?bar
index b31b82b05a166d91fbce864af981bc0dd0fcb376..ab5fbd834e7680f7be060f8e672a88f17b1c97ff 100644 (file)
@@ -1,2 +1,2 @@
-[0-9a-f]*      DF \*UND\*      [0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?bar
-[0-9a-f]*      DF \*UND\*      [0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?foo
+[0-9a-f]*      DF \*UND\*      [0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?_?bar
+[0-9a-f]*      DF \*UND\*      [0-9a-f]*  VERS.0      (0x[0-9a-f][0-9a-f] )?_?foo
index e5b55b169be02317b8465d0a48ffc53ebc696f03..42e81e42d9c05d66eb7283a1da9f783c6b43721c 100644 (file)
@@ -1,15 +1,15 @@
 Relocation section .*
 # Ensure there is a dynamic relocation against x
 #...
-[0-9a-f]+ +[0-9a-f]+ R_.* +x(| \+ 0)
+[0-9a-f]+ +[0-9a-f]+ R_.* +_?x(| \+ 0)
 #...
 Symbol table '.dynsym' contains [0-9]+ entries:
 # And ensure the dynamic symbol table contains at least x@VERS.0
 # and foo@@VERS.0 symbols
 #...
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ foo@)@VERS\.0
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ _?foo@)@VERS\.0
 #...
- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ foo@)@VERS\.0
+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ _?foo@)@VERS\.0
 #...
 Symbol table '.symtab' contains [0-9]+ entries:
 #pass
index 7fef8d8a7661fa6405b769e216e8b5d6ef57ea98..10073d436348172d7531499b9ee9eabb19503d74 100644 (file)
@@ -1,5 +1,7 @@
 /* Test whether .symver x, x@foo
    causes relocations against x within the same shared library
    to become dynamic relocations against x@foo.  */
+#include "vers.h"
+
 int x = 12;
-__asm__ (".symver x, x@VERS.0");
+SYMVER(x, x@VERS.0);
index 267c4243b566a3206266023191ce637720f658b2..6e69b334ba1d94f9a02f58f74bdc3ceba097f17c 100644 (file)
@@ -1,8 +1,10 @@
 /* Test whether .symver x, x@foo
    causes relocations against x within the same shared library
    to become dynamic relocations against x@foo.  */
+#include "vers.h"
+
 int x = 12;
-__asm__ (".symver x, x@VERS.0");
+SYMVER(x, x@VERS.0);
 void foo (void)
 {
   x = 24;
index 6e6573acacba24257a736a8b3e830c7d0a610740..a9d0313952f106c34624653ed7e45f4367d6c7a0 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?foo
index 6e6573acacba24257a736a8b3e830c7d0a610740..a9d0313952f106c34624653ed7e45f4367d6c7a0 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?foo
index 6e6573acacba24257a736a8b3e830c7d0a610740..a9d0313952f106c34624653ed7e45f4367d6c7a0 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?foo
index 7b164c480b820d003b756405f8de9d8ab53368b4..3fe5615baa4f186397b15560bb13e30ef601a349 100644 (file)
@@ -1,2 +1,3 @@
+#include "vers.h"
 void foo () {}
-asm (".hidden foo");
+asm (".hidden " SYMPFX(foo));
index 58b56e85227b9532bac797d65ee89226d4bac3dc..c585799effb7eb6155c7dbe785e031e7fde062ce 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+\(VERS\.0\)[  ]+(0x[0-9a-f]+ )?_?foo
index d4946f5e2055026f51ea66a9d1d06fe70ed1b43c..d20bd1d23497859483eb1e2f0bba7472d47f7a29 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?foo@VERS\.0
+[0-9a-f]+[     ]+g[    ]+F[    ]+\.(text|opd)[         ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0
index 3fc60b04bcd7b7ff751ab679ad3e6b6b3f3683f1..107e1c1de89b24bfcc75add0e7e6c128c23e4cd9 100644 (file)
@@ -1,6 +1,8 @@
+#include "vers.h"
+
 void
 foo ()
 {
 }
 
-asm (".symver foo,foo@VERS.0");
+SYMVER(foo, foo@VERS.0);
index 8c85a4ae9f540b931c924fd4314a3289aa7c9238..dfd6a3321ad051ba5311aa99c1be05bf98a7a892 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS\.0 +(0x[0-9a-f]+ )?_?foo
index 750ee8809c79286c05280e3ad16bf5753b7b56d4..6c35c9be7078d3d8a4c7c848d1103c9179f2f84e 100644 (file)
@@ -1,2 +1,2 @@
 0+[    ]+g[    ]+DO[   ]+\*ABS\*[      ]+0+[   ]+VERS\.0[      ]+VERS\.0
-[0-9a-f]+[     ]+w[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+w[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?foo
index 99f6d881f83c52e2059092d2d7527fa52f9a90b5..7ad56789eeae1819b8ddc5ef599e4cd5f5c3b954 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+[     ]+DF[   ]+\*UND\*[      ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+[     ]+DF[   ]+\*UND\*[      ]+[0-9a-f]+[    ]+VERS\.0[      ]+(0x[0-9a-f]+ )?_?foo
index ed8a230de086dfb4f0e61e0c790ee8cd86121b71..f983d43477ea5cf15be695d30573e20da48a4d06 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+vers29\.so[   ]+(0x[0-9a-f]+ )?show
+[0-9a-f]+[     ]+g[    ]+DF[   ]+\.(text|opd)[ ]+[0-9a-f]+[    ]+vers29\.so[   ]+(0x[0-9a-f]+ )?_?show
index 7396deeca5f691963c0db54f486014b7157eb458..a77f94901277f8aa7aa1394317b0cd46d3869498 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2\.0 +(0x[0-9a-f]+ )?_?show_foo
index ddb21eb38b0c73f52f75c2ae4d0e895891b3f7e3..5762f01843ccf6d31d7bef5287320a68e8ca975f 100644 (file)
@@ -1,5 +1,5 @@
 0+ g    DO \*ABS\*     0+  VERS_30\.0   VERS_30\.0
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   global
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   foo
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   info
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   extern
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   _?global
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   _?foo
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   _?info
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_30\.0   _?extern
index 72dec06aff251ac2cc1fe01a1590bd3cefde3106..fb22f5b87ca35c204a2b5f328ad1e9f496a1fb6b 100644 (file)
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*       0+ +VERS_31\.0 +VERS_31\.0
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_31\.0 +_Z1fIA3_icEvPT_T0
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_31\.0 +_?_Z1fIA3_icEvPT_T0
index 47d1b06bff9b4582fbd500b6f94ebdb5cbc885dd..24deae4987dc4c1dc4b0a1232a4d795cbf6ff9f4 100644 (file)
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*       0+ +VERS_1 +VERS_1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?_?foo
index 88b34744722cfc4a2be7522fa8a9d4ef58099daf..a2fc578bba856494f11bd3851e01ea3d432f757f 100644 (file)
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +D +\*ABS\*        [0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g +D +\*ABS\*        [0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?_?foo
 0+ g +DO \*ABS\*       0+ +VERS_1 +VERS_1
index 453f2eb4d9c951f98dfa67e7567ade524197fed7..46ac43258de86a8fa9ba4994d6ea7ed0e70b2cdc 100644 (file)
@@ -5,6 +5,7 @@
  * -export-dynamic.
  */
 #include <stdio.h>
+#include "vers.h"
 
 extern int foo ();
 
@@ -21,7 +22,7 @@ new_foo()
 
 }
 
-__asm__(".symver new_foo,foo@@VERS_2.0");
+SYMVER(new_foo, foo@@VERS_2.0);
 
 int
 main()
index 395e69910bbd22c911e903a11b9c747bdbba1620..c48d1bb09f1038fb902b889e1bc248e5a44314f4 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?foo@@VERS_2\.0
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0
index a7efb0aef61c390e177d124e949ceab2c2ab9dcd..96dfea8a976c53611990ae52ec27209be250d1a2 100644 (file)
@@ -1,2 +1,2 @@
 0+ g    DO \*ABS\*     0+  VERS_2\.0    VERS_2\.0
-[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_2\.0    (0x[0-9a-f]+ )?foo
+[0-9a-f]+ g    DF (\.text|\.opd|\*ABS\*)       [0-9a-f]+  VERS_2\.0    (0x[0-9a-f]+ )?_?foo
index 395e69910bbd22c911e903a11b9c747bdbba1620..c48d1bb09f1038fb902b889e1bc248e5a44314f4 100644 (file)
@@ -1 +1 @@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?foo@@VERS_2\.0
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0
index cc6ea40b6784dede48e99f3d876854f3cae62598..3cae67ebc924f6b23ee5d373a3bcc38ed572ae97 100644 (file)
@@ -2,6 +2,8 @@
  * Testcase to verify that foo@BAR and foo@@BAR are correctly detected
  * as a multiply defined symbol.
  */
+#include "vers.h"
+
 const char * bar1 = "asdf";
 const char * bar2 = "asdf";
 
@@ -39,10 +41,10 @@ new_foo()
 
 }
 
-__asm__(".symver original_foo,foo@");
-__asm__(".symver old_foo,foo@VERS_1.1");
-__asm__(".symver old_foo1,foo@VERS_1.2");
-__asm__(".symver new_foo,foo@@VERS_1.2");
+SYMVER(original_foo, foo@);
+SYMVER(old_foo, foo@VERS_1.1);
+SYMVER(old_foo1, foo@VERS_1.2);
+SYMVER(new_foo, foo@@VERS_1.2);
 
 int
 main ()
index 9e48df9b4009588b5100b8baefec114625280337..cb1c93f635a18e664166f4697bac0a916c1c2201 100644 (file)
@@ -3,6 +3,7 @@
  * that we always get the right one.
  */
 #include <stdio.h>
+#include "vers.h"
 
 extern int foo_1();
 extern int foo_2();
@@ -19,7 +20,7 @@ main()
   return 0;
 }
 
-__asm__(".symver foo_1,show_foo@");
-__asm__(".symver foo_2,show_foo@VERS_1.1");
-__asm__(".symver foo_3,show_foo@VERS_1.2");
-__asm__(".symver foo_4,show_foo@VERS_2.0");
+SYMVER(foo_1, show_foo@);
+SYMVER(foo_2, show_foo@VERS_1.1);
+SYMVER(foo_3, show_foo@VERS_1.2);
+SYMVER(foo_4, show_foo@VERS_2.0);
index 79e9061a92bd21c5c404b9561a2c22a1caf84045..a53099bbedb4d19c79d69be74cd80505577a3f78 100644 (file)
@@ -1,4 +1,4 @@
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2.0 +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_1.2 +(0x[0-9a-f]+ )?show_foo
-[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_1.1 +(0x[0-9a-f]+ )?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_2.0 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_1.2 +(0x[0-9a-f]+ )?_?show_foo
+[0-9a-f]+ +DF \*UND\*  [0-9a-f]+ +VERS_1.1 +(0x[0-9a-f]+ )?_?show_foo
index 801f7b3618aae78134914259afcfb5c32bf10648..ae68d724e201fb82b0a00e5017d9267a19662660 100644 (file)
@@ -1,4 +1,4 @@
-0+ *F? *\*UND\*        0+ show_foo@
-0+ *F? *\*UND\*        0+ show_foo@VERS_1\.1
-0+ *F? *\*UND\*        0+ show_foo@VERS_1\.2
-0+ *F? *\*UND\*        0+ show_foo@VERS_2\.0
+0+ *F? *\*UND\*        0+ _?show_foo@
+0+ *F? *\*UND\*        0+ _?show_foo@VERS_1\.1
+0+ *F? *\*UND\*        0+ _?show_foo@VERS_1\.2
+0+ *F? *\*UND\*        0+ _?show_foo@VERS_2\.0
index 7bee8c70bfe3707ce7235cccad4aef5d1a795b98..f3d2a2d989706ae51091457b9db5c96d29929123 100644 (file)
@@ -2,6 +2,8 @@
  * Test supplied by Ulrich.  Verify that we can correctly force 'a'
  * to local scope.
  */
+#include "vers.h"
+
 int
 __a_internal (int e)
 {
@@ -14,5 +16,5 @@ __b_internal (int e)
   return e + 42;
 }
 
-asm (".symver __a_internal,hide_a@@VERS_1");
-asm (".symver __b_internal,show_b@@VERS_1");
+SYMVER(__a_internal, hide_a@@VERS_1);
+SYMVER(__b_internal, show_b@@VERS_1);
index 8434925f6749ac70cef523ad2dc96c61b48b57dc..89a45a54308669c512d7e680755ce16299d055db 100644 (file)
@@ -1,2 +1,2 @@
 0+ g +DO \*ABS\*       0+ +VERS_1 +VERS_1
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?show_b
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1 +(0x[0-9a-f]+ )?_?show_b
index 94d9312bd4dc93bd543bb25732ae7696b4820486..ef8d04be0bbc28c81b0fd394b59d656dca992b4b 100644 (file)
@@ -1,2 +1,2 @@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?hide_a@@VERS_1
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?show_b@@VERS_1
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?hide_a@@VERS_1
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?show_b@@VERS_1
index bef1402d2699657dabc7cb8697bac5d807a4b9f1..50793640915f98fb51c9b31b7a6a6050b0d4b5c0 100644 (file)
@@ -2,6 +2,8 @@
  * Testcase to verify that reference to foo@BAR and a definition of foo@@BAR
  * are not treated as a multiple def.
  */
+#include "vers.h"
+
 const char * bar1 = "asdf";
 const char * bar2 = "asdf";
 
@@ -41,7 +43,7 @@ main()
   return 0;
 }
 
-__asm__(".symver original_foo,foo@");
-__asm__(".symver old_foo,foo@VERS_1.1");
-__asm__(".symver old_foo1,foo@VERS_1.2");
-__asm__(".symver new_foo,foo@@VERS_1.2");
+SYMVER(original_foo, foo@);
+SYMVER(old_foo, foo@VERS_1.1);
+SYMVER(old_foo1, foo@VERS_1.2);
+SYMVER(new_foo, foo@@VERS_1.2);
index 5443e67dd0b680992ccfd1e2f0bae5cbb7b71903..411451a28b353fc6eeab08096804ecb5ae211539 100644 (file)
@@ -1,4 +1,4 @@
 0+ g +DO \*ABS\*       0+ +VERS_1\.1 +VERS_1\.1
 0+ g +DO \*ABS\*       0+ +VERS_1\.2 +VERS_1\.2
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?foo
-[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ \(VERS_1\.1\) +(0x[0-9a-f]+ )?_?foo
+[0-9a-f]+ g +DF (\.text|\.opd|\*ABS\*) [0-9a-f]+ +VERS_1\.2 +(0x[0-9a-f]+ )?_?foo
index 6d6585fd6ce99b20de4989fe98a6d85c05c8d8f5..be0e6ddb2003d16beb1d99976ce2e7f23e0448fb 100644 (file)
@@ -1,4 +1,4 @@
-0+ *F? *\*UND\*        0+ foo@VERS_1\.2
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?foo@
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?foo@VERS_1\.1
-[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?foo@@VERS_1\.2
+0+ *F? *\*UND\*        0+ _?foo@VERS_1\.2
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS_1\.1
+[0-9a-f]+ g +F \.(text|opd)    [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_1\.2
index 36c12d9f147cd05b1319bac0e7dc0e1f00d57067..d288774adae7d57afe6d983c1923e12664f128e2 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ld-visibility tests
-#   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+#   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -30,6 +30,7 @@
 if { ![istarget hppa*64*-*-hpux*] \
      && ![istarget hppa*-*-linux*] \
      && ![istarget i?86-*-linux*] \
+     && ![istarget i?86-*-gnu*] \
      && ![istarget ia64-*-linux*] \
      && ![istarget m68k-*-linux*] \
      && ![istarget mips*-*-linux*] \
@@ -115,7 +116,8 @@ if [istarget arm*-*-linux*] {
 
 set support_protected "no"
 
-if [istarget *-*-linux*] {
+if { [istarget *-*-linux*]
+     || [istarget *-*-gnu*] } {
     if [ld_compile "$CC -g $CFLAGS -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] {
       if [ld_simple_link $CC $tmpdir/main "$tmpdir/main.o"] {
        catch "exec $tmpdir/main" support_protected
index cac613b7252d262b39ae6dde064cdc86224e552d..0cc1299351e6cbbae5277555d626e2154441391f 100644 (file)
@@ -1,5 +1,6 @@
 # Expect script for ld-weak tests
-#   Copyright 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2010
+#   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -28,32 +29,32 @@ if ![isnative] then {return}
 # This test can only be run on a couple of ELF platforms.
 # Square bracket expressions seem to confuse istarget.
 # This is similar to the test that is used in ld-shared, BTW.
-if {    ![istarget alpha*-*-linux*] \
-     && ![istarget arm*-*-linux*] \
-     && ![istarget hppa*64*-*-hpux*] \
-     && ![istarget hppa*-*-linux*] \
-     && ![istarget i?86-*-sysv4*] \
-     && ![istarget i?86-*-unixware] \
-     && ![istarget i?86-*-elf*] \
-     && ![istarget i?86-*-linux*] \
-     && ![istarget ia64-*-elf*] \
-     && ![istarget ia64-*-linux*] \
-     && ![istarget m68k-*-linux*] \
-     && ![istarget mips*-*-irix5*] \
-     && ![istarget mips*-*-linux*] \
-     && ![istarget powerpc*-*-elf*] \
-     && ![istarget powerpc*-*-linux*] \
-     && ![istarget powerpc*-*-sysv4*] \
-     && ![istarget sh\[34\]*-*-linux*] \
-     && ![istarget sparc*-*-elf] \
-     && ![istarget sparc*-*-solaris2*] \
+if {    ![istarget alpha*-*-linux*]
+     && ![istarget arm*-*-linux*]
+     && ![istarget hppa*64*-*-hpux*]
+     && ![istarget hppa*-*-linux*]
+     && ![istarget i?86-*-sysv4*]
+     && ![istarget i?86-*-unixware]
+     && ![istarget i?86-*-elf*]
+     && ![istarget i?86-*-linux*]
+     && ![istarget i?86-*-gnu*]
+     && ![istarget ia64-*-elf*]
+     && ![istarget ia64-*-linux*]
+     && ![istarget m68k-*-linux*]
+     && ![istarget mips*-*-irix5*]
+     && ![istarget mips*-*-linux*]
+     && ![istarget powerpc*-*-elf*]
+     && ![istarget powerpc*-*-linux*]
+     && ![istarget powerpc*-*-sysv4*]
+     && ![istarget sh\[34\]*-*-linux*]
+     && ![istarget sparc*-*-elf]
+     && ![istarget sparc*-*-solaris2*]
      && ![istarget sparc*-*-linux*] } {
     return
 }
 
-if { [istarget i?86-*-linux*aout*] \
-     || [istarget i?86-*-linux*oldld*] \
-     || [istarget m68k-*-linux*aout*] } {
+if { [istarget *-*-linux*aout*]
+     || [istarget *-*-linux*oldld*] } {
     return
 }
 
@@ -67,6 +68,18 @@ set DOBJDUMP_FLAGS --dynamic-syms
 set SOBJDUMP_FLAGS --syms
 set shared --shared
 
+
+# <http://www.gnu.org/software/hurd/open_issues/binutils.html#weak>
+proc setup_xfail_gnu_hurd {} {
+    global target_triplet
+    # Be cautious to not XFAIL for *-*-linux-gnu*, *-*-kfreebsd-gnu*, etc.
+    switch -regexp $target_triplet {
+       ^\[^-\]*-\[^-\]*-gnu.*$ {
+           setup_xfail "*-*-*"
+       }
+    }
+}
+
 #
 # objdump_symstuff
 #      Dump non-dynamic symbol stuff and make sure that it is sane.
@@ -290,7 +303,7 @@ proc build_lib {test libname objs dynsymexp} {
        return
     }
 
-    if {![string match "" $dynsymexp] \
+    if {![string match "" $dynsymexp]
        && ![objdump_dynsymstuff $objdump $tmpdir/$libname.so $srcdir/$subdir/$dynsymexp]} {
        fail $test
        return
@@ -368,9 +381,9 @@ if [istarget mips*-*-*] {
     catch "exec $CC $picflag" exec_output
     send_log "$exec_output\n"
     verbose "--" "$exec_output"
-    if { [string match "*illegal option*" $exec_output] \
-        || [string match "*option ignored*" $exec_output] \
-        || [string match "*unrecognized option*" $exec_output] \
+    if { [string match "*illegal option*" $exec_output]
+        || [string match "*option ignored*" $exec_output]
+        || [string match "*unrecognized option*" $exec_output]
         || [string match "*passed to ld*" $exec_output] } {
        if [istarget *-*-sunos4*] {
            set picflag "-pic"
@@ -452,7 +465,9 @@ build_lib "ELF DSO weak func first DSO" libfoo "foo.o libbar.so" dsow.dsym
 build_lib "ELF DSO weak func last DSO" libfoo "libbar.so foo.o" dsow.dsym
 build_exec "ELF weak func first" foo "main.o bar.o" "" strong "" strong.sym
 build_exec "ELF weak func last" foo "bar.o main.o" "" strong "" strong.sym
+setup_xfail_gnu_hurd
 build_exec "ELF weak func first DSO" foo "main.o libbar.so" "-Wl,-rpath,." weak weak.dsym ""
+setup_xfail_gnu_hurd
 build_exec "ELF weak func last DSO" foo "libbar.so main.o" "-Wl,-rpath,." weak weak.dsym ""
 
 build_lib "ELF DSO weak data first" libfoo "bar1a.o foo1a.o" dsodata.dsym
@@ -465,9 +480,13 @@ build_exec "ELF weak data first" foo "main1.o bar1a.o foo1a.o" "" strongdata ""
 build_exec "ELF weak data last" foo "foo1a.o main1.o bar1a.o" "" strongdata "" strongdata.sym
 build_exec "ELF weak data first common" foo "main1.o bar1a.o foo1b.o" "" strongdata "" strongcomm.sym
 build_exec "ELF weak data last common" foo "foo1b.o main1.o bar1a.o" "" strongdata "" strongcomm.sym
+setup_xfail_gnu_hurd
 build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+setup_xfail_gnu_hurd
 build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+setup_xfail_gnu_hurd
 build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+setup_xfail_gnu_hurd
 build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
 
 if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/size_foo.c $tmpdir/size_foo.o] {
index aed0a8b61e44f15042af377a83cd0ca2624f5547..d796ccccfe654c141c0663370d7701145d486874 100644 (file)
@@ -1,7 +1,7 @@
 #name: --gc-sections with note section
 #ld: --gc-sections -e _start
 #readelf: -S --wide
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 #notarget: *-*-*aout *-*-*oldld
 
 #...
index 095f7642d9f3adf6b65c54517e2feeff986a3766..b7d6dffd90bcb876a5ed78c121ee13318fd3be9b 100644 (file)
@@ -98,7 +98,8 @@ run_dump_test "noent"
 run_dump_test "abi-note"
 run_dump_test "start"
 if { [is_remote host] || [which $CC] != 0 } {
-    if { [istarget "*-*-linux*"] } {
+    if { [istarget "*-*-linux*"]
+        || [istarget "*-*-gnu*"] } {
        ld_compile "$CC -fPIC $CFLAGS $cflags" $srcdir/$subdir/pr11218-1.c tmpdir/pr11218-1.o
        ld_simple_link $ld tmpdir/pr11218-1.so "-shared tmpdir/pr11218-1.o"
        ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/pr11218-2.c tmpdir/pr11218-2.o
index 2515bc6013ca2d80a0257a7f25e4031dfe2ba95f..5f158026f83b570255edca143612fb201a10bbb4 100644 (file)
@@ -1,4 +1,5 @@
 extern void foo_in_so(void);
+extern void unresolved_detected_at_runtime_not_at_linktime (void);
 
 void call_unresolved(void)
 {
index 27019a801faa8182df9254ac2cd39435c44c07f0..fc2694023383fe6637ff38f7e86070237113658f 100644 (file)
@@ -1,5 +1,5 @@
 # name: --gc-sections with shared library
 # source: dummy.s
 # ld: --gc-sections -e main tmpdir/pr11218-2.o tmpdir/pr11218-1.so
-# target: *-*-linux*
+# target: *-*-linux* *-*-gnu*
 # error: undefined reference to `unresolved_detected_at_runtime_not_at_linktime'
index 80c43d9e4c062b80d0b300e21b1f82711d9d50a3..28007353744ee797a1d755945197628de39c3b96 100644 (file)
@@ -1,7 +1,7 @@
 #name: --gc-sections with __start_
 #ld: --gc-sections -e _start
 #nm: -n
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 #notarget: *-*-*aout *-*-*oldld
 
 #...
index 6777c5f675572fbd5e7e90a3b5bab98b8aab2aa9..de8f892e0a5d90d877643fc0974b34890e0cc31b 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ld-i386 tests
-#   Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009
+#   Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009, 2010
 #   Free Software Foundation
 #
 # This file is part of the GNU Binutils.
@@ -99,7 +99,8 @@ if [istarget "*-*-go32*"] {
 }
 
 if { !([istarget "i?86-*-elf*"]                
-       || ([istarget "i?86-*-linux*"]
+       || (([istarget "i?86-*-linux*"]
+           || [istarget "i?86-*-gnu*"])
           && ![istarget "*-*-*aout*"]
           && ![istarget "*-*-*oldld*"])
        || [istarget "x86_64-*-linux*"]
@@ -194,6 +195,7 @@ run_dump_test "nogot2"
 run_dump_test "discarded1"
 
 if { !([istarget "i?86-*-linux*"]
+       || [istarget "i?86-*-gnu*"]
        || [istarget "x86_64-*-linux*"]) } {
     return
 }
index bd6c9536449f35e4854b6b086832f19d3cf8013b..d24caf8edf156e95fd9395d4378ccf893b776da8 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for binutils tests
-#   Copyright 2009 Free Software Foundation, Inc.
+#   Copyright 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -24,9 +24,9 @@
 # Make sure that binutils can correctly handle ld output in ELF with
 # STT_GNU_IFUNC symbols.
 
-# Run on Linux/x86 only.
 if { !([istarget "i?86-*-elf*"]                
-       || ([istarget "i?86-*-linux*"]
+       || (([istarget "i?86-*-linux*"]
+           || [istarget "i?86-*-gnu*"])
           && ![istarget "*-*-*aout*"]
           && ![istarget "*-*-*oldld*"])
        || [istarget "x86_64-*-linux*"]
index 38fe2d39046c437cc042ad1c6c4170d7a3221db5..6c20dc079b96a8b1ee02c30dc77f9274ff799b77 100644 (file)
@@ -1,6 +1,6 @@
 # Expect script for linker support of IFUNC symbols and relocations.
 #
-#   Copyright 2009  Free Software Foundation, Inc.
+#   Copyright 2009, 2010 Free Software Foundation, Inc.
 #   Contributed by Red Hat.
 #
 # This file is part of the GNU Binutils.
@@ -30,7 +30,8 @@ if {!(([istarget "i?86-*-*"]
        || [istarget "powerpc*-*-*"]
        || [istarget "sparc*-*-*"])
       && ([istarget "*-*-elf*"]
-         || ([istarget "*-*-linux*"]
+         || (([istarget "*-*-linux*"]
+              || [istarget "*-*-gnu*"])
              && ![istarget "*-*-*aout*"]
              && ![istarget "*-*-*oldld*"]))) } {
     verbose "IFUNC tests not run - target does not support IFUNC"
index 53287340e1a5ed8299d0822d8d742255d91669bc..e8b85ac65e420c55607f497420f9f120542267c5 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for ld linkonce tests
-#   Copyright 2001, 2002, 2005, 2007 Free Software Foundation, Inc.
+#   Copyright 2001, 2002, 2005, 2007, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -25,7 +25,7 @@
 # have to qualify on ELF specifically in every .d-file.
 
 if { ![istarget *-*-linux*] \
-     && ![istarget *-*-gnu] \
+     && ![istarget *-*-gnu*] \
      && ![istarget hppa*64*-*-hpux*] \
      && ![istarget *-*-elf] } {
     return
index 5b51836588c08d06c36be6e07267e87165fbd873..bd8fc6f67ea65a0ce4bb12c6080cae98416e3bb0 100644 (file)
@@ -2,7 +2,7 @@
 #source: y.s
 #ld: -Ttext 0xa00 -T zeroeh.ld
 #objdump: -s
-#target: cris-*-elf cris-*-linux* i?86-*-elf i?86-*-linux*
+#target: cris-*-elf cris-*-linux* i?86-*-elf i?86-*-linux* i?86-*-gnu*
 
 # The word at address 201c, for the linkonce-excluded section, must be zero.
 
index 19a2ac01c40b2fb6f0f43b73d13e76e495fd00d4..ea4370c66fde6bdd449e7731bd7c1b5d2ce45f61 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various PIE tests.
-#   Copyright 2006, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -22,8 +22,8 @@
 # This test can only be run if ld generates native executables.
 if ![isnative] then {return}
 
-# Run on Linux only.
-if { ![istarget *-*-linux*] } {
+if { ![istarget *-*-linux*]
+     && ![istarget *-*-gnu*] } {
     return
 }
 
index 57778d20e903244d0f042c3f42d2fe93397f90f0..e75acfb7671d659418846d210110ed881c662f9d 100644 (file)
@@ -1,5 +1,5 @@
 # Test PHDRS with empty sections in a linker script.
-# Copyright 2006, 2005, 2007  Free Software Foundation, Inc,
+# Copyright 2006, 2005, 2007, 2010 Free Software Foundation, Inc,
 #
 # This file is part of the GNU Binutils.
 #
@@ -25,6 +25,7 @@ if {    ![istarget *-*-sysv4*] \
      && ![istarget *-*-eabi*] \
      && ![istarget hppa*64*-*-hpux*] \
      && ![istarget *-*-linux*] \
+     && ![istarget *-*-gnu*] \
      && ![istarget *-*-irix5*] \
      && ![istarget *-*-irix6*] \
      && ![istarget *-*-solaris2*] } {
index 972c6c2da593f413b8248c07b7b8052d560e9133..7ba9cafb2f109c07d53ac6939d0b7f842ed35543 100644 (file)
@@ -2,7 +2,7 @@
 # source: rgn-at5.s
 # ld: -T rgn-at5.t -z max-page-size=0x1000
 # objdump: -w -h
-# target: *-*-linux*
+# target: *-*-linux* *-*-gnu*
 # xfail: rx-*-*
 #   FAILS on the RX because the linker has to set LMA == VMA for the
 #   Renesas loader.
index 2e699228ad17b5b1b398ef66b949dc6dcaaf4f27..267c0be7278b8127b98548381272414649e0bee0 100644 (file)
@@ -130,9 +130,10 @@ if ![ld_simple_link $ld tmpdir/script "$flags -T $srcdir/$subdir/memory.t tmpdir
 set test_script_list [lsort [glob $srcdir/$subdir/region-alias-*.t]]
 
 foreach test_script $test_script_list {
+    set testname [file tail $test_script]
     if ![ld_simple_link $ld tmpdir/script "$flags -T $test_script tmpdir/script.o"] {
-        xfail "REGION_ALIAS: $test_script"
+        xfail "REGION_ALIAS: $testname"
     } else {
-        xpass "REGION_ALIAS: $test_script"
+        xpass "REGION_ALIAS: $testname"
     }
 }
index b563d355b2fcc0075eca5877671672f6cb963590..81870c2a0549df2071e0fe4c7496200f2938e1c5 100644 (file)
@@ -60,7 +60,7 @@ set seltests {
 }
 
 set cflags "-w -O -ffunction-sections -fdata-sections"
-set cxxflags "-fvtable-gc -fno-exceptions -fno-rtti"
+set cxxflags "-fno-exceptions -fno-rtti"
 set ldflags "--gc-sections -Bstatic"
 
 if [istarget mips*-*] {
@@ -106,14 +106,16 @@ foreach testitem $seltests {
 
     # It's either C or C++ at the moment.
     if { $testtype == "C++" } {
-       set testflags "$cflags $cxxflags"
        set compiler "$CXX"
        # Starting with 3.4.0, -fvtable-gc is no longer supported and thus
        # the functionality we try to test for cannot be expected to work.
        set version [remote_exec host "$CXX -dumpversion"]
        set version [lindex $version 1]
        if [regexp "^(\[1-9\]\[0-9\]+|\[4-9\]|3.(\[1-9\]\[0-9\]+|\[4-9\]))\\." $version] {
+           set testflags "$cflags $cxxflags"
            setup_xfail {*-*-*}
+       } else {
+           set testflags "$cflags $cxxflags -fvtable-gc"
        }
     } else {
        set testflags "$cflags"
index 521b9255722ffbd432e69bf284c05e272bd60e18..b77b9cea2a65b8617c1dbd4b296cc545fdb0579b 100644 (file)
@@ -1,6 +1,6 @@
 # Expect script for ld-shared tests
 #   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-#   2004, 2005, 2007, 2008, 2009
+#   2004, 2005, 2007, 2008, 2009, 2010
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -38,6 +38,7 @@ if { ![istarget hppa*64*-*-hpux*] \
      && ![istarget i?86-*-unixware] \
      && ![istarget i?86-*-elf*] \
      && ![istarget i?86-*-linux*] \
+     && ![istarget i?86-*-gnu*] \
      && ![istarget ia64-*-elf*] \
      && ![istarget ia64-*-linux*] \
      && ![istarget m68k-*-linux*] \
index 184f4788a0c9a4f3b9f6c050a4688bddf54f7fef..ca91765979080caece31a0e1c0d8e152228d4fac 100644 (file)
@@ -2,7 +2,7 @@
 #source: dummy.s
 #ld: -shared --entry foo tmpdir/libentry.a
 #nm: -n
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
 [0-9a-f]+ T +foo
index 44006aa85c686609191bbe8409ce62e6dde48f5f..d02808e0d40c03376b135c3c87d9517aefbe53de 100644 (file)
@@ -2,7 +2,7 @@
 #source: dummy.s
 #ld: -shared --entry foo -u foo tmpdir/libentry.a
 #nm: -n
-#target: *-*-linux*
+#target: *-*-linux* *-*-gnu*
 
 #...
 [0-9a-f]+ T +foo
index a4f35e4189d3cd3b1a79df2486fc6fa7790467cd..e7e949ac8bfc25b42f401a5c33bf58b001c33a3a 100644 (file)
@@ -1,5 +1,5 @@
 # Test handling of weak undefined symbols
-#   Copyright 2001, 2002, 2004, 2005, 2007
+#   Copyright 2001, 2002, 2004, 2005, 2007, 2010
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -30,6 +30,7 @@ if { ![istarget *-*-sysv4*] \
      && ![istarget *-*-eabi*] \
      && ![istarget hppa*64*-*-hpux*] \
      && ![istarget *-*-linux*] \
+     && ![istarget *-*-gnu*] \
      && ![istarget *-*-irix5*] \
      && ![istarget *-*-irix6*] \
      && ![is_pecoff_format] \
index 3d120c8264bd5c854333c77f31e805743c4a10c9..48e9635d03f337741769f35c66a1e654e2e0ff1a 100644 (file)
 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
 # MA 02110-1301, USA.
 
+proc load_common_lib { name } {
+    global srcdir
+    load_file $srcdir/../../binutils/testsuite/lib/$name
+}
+
+load_common_lib binutils-common.exp
+
 # Extract and print the version number of ld.
 #
 proc default_ld_version { ld } {
@@ -401,206 +408,6 @@ proc ld_simple_link_defsyms {} {
     return $flags
 }
 
-# True if the object format is known to be ELF.
-#
-proc is_elf_format {} {
-    if { ![istarget *-*-sysv4*]
-        && ![istarget *-*-unixware*]
-        && ![istarget *-*-elf*]
-        && ![istarget *-*-eabi*]
-        && ![istarget *-*-rtems*]
-        && ![istarget hppa*64*-*-hpux*]
-        && ![istarget ia64-*-hpux*]
-        && ![istarget *-*-linux*]
-        && ![istarget frv-*-uclinux*]
-        && ![istarget bfin-*-uclinux]
-        && ![istarget sh*-*-uclinux*]
-        && ![istarget *-*-irix5*]
-        && ![istarget *-*-irix6*]
-        && ![istarget *-*-netbsd*]
-        && ![istarget *-*-openbsd*]
-        && ![istarget *-*-solaris2*] } {
-       return 0
-    }
-
-    if { [istarget *-*-linux*aout*]
-        || [istarget *-*-linux*oldld*]
-        || [istarget h8500-*-rtems*]
-        || [istarget i960-*-rtems*]
-        || [istarget *-*-rtemscoff*] } {
-       return 0
-    }
-
-    if { ![istarget *-*-netbsdelf*]
-        && ([istarget *-*-netbsd*aout*]
-            || [istarget *-*-netbsdpe*]
-            || [istarget arm*-*-netbsd*]
-            || [istarget sparc-*-netbsd*]
-            || [istarget i*86-*-netbsd*]
-            || [istarget m68*-*-netbsd*]
-            || [istarget vax-*-netbsd*]
-            || [istarget ns32k-*-netbsd*]) } {
-       return 0
-    }
-
-    if { [istarget arm-*-openbsd*]
-        || [istarget i386-*-openbsd\[0-2\].*]
-        || [istarget i386-*-openbsd3.\[0-2\]]
-        || [istarget m68*-*-openbsd*]
-        || [istarget ns32k-*-openbsd*]
-        || [istarget sparc-*-openbsd\[0-2\].*]
-        || [istarget sparc-*-openbsd3.\[0-1\]]
-        || [istarget vax-*-openbsd*] } {
-       return 0
-    }
-
-    return 1
-}
-
-# True if the object format is known to be 64-bit ELF.
-#
-proc is_elf64 { binary_file } {
-    global READELF
-    global READELFFLAGS
-
-    set readelf_size ""
-    catch "exec $READELF $READELFFLAGS -h $binary_file > readelf.out" got
-
-    if ![string match "" $got] then {
-       return 0
-    }
-
-    if { ![regexp "\n\[ \]*Class:\[ \]*ELF(\[0-9\]+)\n" \
-          [file_contents readelf.out] nil readelf_size] } {
-       return 0
-    }
-
-    if { $readelf_size == "64" } {
-       return 1
-    }
-
-    return 0
-}
-
-# True if the object format is known to be a.out.
-#
-proc is_aout_format {} {
-    if { [istarget *-*-netbsdelf]
-        || [istarget sparc64-*-netbsd*]
-        || [istarget sparc64-*-openbsd*] } {
-       return 0
-    }
-    if { [istarget *-*-*\[ab\]out*]
-        || [istarget *-*-linux*oldld*]
-        || [istarget *-*-bsd*]
-        || [istarget *-*-msdos*]
-        || [istarget arm-*-netbsd*]
-        || [istarget arm-*-openbsd*]
-        || [istarget arm-*-riscix*]
-        || [istarget i?86-*-freebsd\[12\]*]
-        || [istarget i?86-*-netbsd*]
-        || [istarget i?86-*-openbsd\[0-2\]*]
-        || [istarget i?86-*-openbsd3.\[0-2\]*]
-        || [istarget i?86-*-vsta]
-        || [istarget i?86-*-mach*]
-        || [istarget m68*-*-netbsd*]
-        || [istarget m68*-*-openbsd*]
-        || [istarget ns32k-*-*]
-        || [istarget pdp11-*-*]
-        || [istarget sparc*-*-sunos4*]
-        || [istarget sparc*-*-netbsd*]
-        || [istarget sparc*-*-openbsd\[0-2\]*]
-        || [istarget sparc*-*-openbsd3.\[0-1\]*]
-        || [istarget sparc*-fujitsu-none]
-        || [istarget vax-dec-ultrix*]
-        || [istarget vax-*-netbsd] } {
-       return 1
-    }
-    return 0
-}
-
-# True if the object format is known to be PE COFF.
-#
-proc is_pecoff_format {} {
-    if { ![istarget *-*-mingw*]
-        && ![istarget *-*-cygwin*]
-        && ![istarget *-*-cegcc*]
-        && ![istarget *-*-pe*] } {
-       return 0
-    }
-
-    return 1
-}
-
-# Compares two files line-by-line.
-#   Returns differences if exist.
-#   Returns null if file(s) cannot be opened.
-#
-proc simple_diff { file_1 file_2 } {
-    global target
-
-    set eof -1
-    set differences 0
-
-    if [file exists $file_1] then {
-       set file_a [open $file_1 r]
-    } else {
-       warning "$file_1 doesn't exist"
-       return
-    }
-
-    if [file exists $file_2] then {
-       set file_b [open $file_2 r]
-    } else {
-       fail "$file_2 doesn't exist"
-       return
-    }
-
-    verbose "# Diff'ing: $file_1 $file_2\n" 2
-
-    while { [gets $file_a line] != $eof } {
-       if [regexp "^#.*$" $line] then {
-           continue
-       } else {
-           lappend list_a $line
-       }
-    }
-    close $file_a
-
-    while { [gets $file_b line] != $eof } {
-       if [regexp "^#.*$" $line] then {
-           continue
-       } else {
-           lappend list_b $line
-       }
-    }
-    close $file_b
-
-    for { set i 0 } { $i < [llength $list_a] } { incr i } {
-       set line_a [lindex $list_a $i]
-       set line_b [lindex $list_b $i]
-
-       verbose "\t$file_1: $i: $line_a\n" 3
-       verbose "\t$file_2: $i: $line_b\n" 3
-       if [string compare $line_a $line_b] then {
-           verbose -log "\t$file_1: $i: $line_a\n"
-           verbose -log "\t$file_2: $i: $line_b\n"
-
-           fail "Test: $target"
-           return
-       }
-    }
-
-    if { [llength $list_a] != [llength $list_b] } {
-       fail "Test: $target"
-       return
-    }
-
-    if $differences<1 then {
-       pass "Test: $target"
-    }
-}
-
 # run_dump_test FILE
 # Copied from gas testsuite, tweaked and further extended.
 #
@@ -701,8 +508,8 @@ proc simple_diff { file_1 file_2 } {
 #
 # After the option lines come regexp lines.  `run_dump_test' calls
 # `regexp_diff' to compare the output of the dumping tool against the
-# regexps in FILE.d.  `regexp_diff' is defined later in this file; see
-# further comments there.
+# regexps in FILE.d.  `regexp_diff' is defined in binutils-common.exp;
+# see further comments there.
 #
 proc run_dump_test { name } {
     global subdir srcdir
@@ -1067,123 +874,6 @@ proc slurp_options { file } {
     return $opt_array
 }
 
-# regexp_diff, copied from gas, based on simple_diff above.
-#      compares two files line-by-line
-#      file1 contains strings, file2 contains regexps and #-comments
-#      blank lines are ignored in either file
-#      returns non-zero if differences exist
-#
-proc regexp_diff { file_1 file_2 } {
-
-    set eof -1
-    set end_1 0
-    set end_2 0
-    set differences 0
-    set diff_pass 0
-    set fail_if_match 0
-
-    if [file exists $file_1] then {
-       set file_a [open $file_1 r]
-    } else {
-       warning "$file_1 doesn't exist"
-       return 1
-    }
-
-    if [file exists $file_2] then {
-       set file_b [open $file_2 r]
-    } else {
-       fail "$file_2 doesn't exist"
-       close $file_a
-       return 1
-    }
-
-    verbose " Regexp-diff'ing: $file_1 $file_2" 2
-
-    while { 1 } {
-       set line_a ""
-       set line_b ""
-       while { [string length $line_a] == 0 } {
-           if { [gets $file_a line_a] == $eof } {
-               set end_1 1
-               break
-           }
-       }
-       while { [string length $line_b] == 0 || [string match "#*" $line_b] } {
-           if [ string match "#pass" $line_b ] {
-               set end_2 1
-               set diff_pass 1
-               break
-           } elseif [ string match "#failif" $line_b ] {
-               send_log "fail if no difference\n"
-               verbose "fail if no difference" 3
-               set fail_if_match 1
-           } elseif [ string match "#..." $line_b ] {
-               if { [gets $file_b line_b] == $eof } {
-                   set end_2 1
-                   set diff_pass 1
-                   break
-               }
-               verbose "looking for \"^$line_b$\"" 3
-               while { ![regexp "^$line_b$" "$line_a"] } {
-                   verbose "skipping    \"$line_a\"" 3
-                   if { [gets $file_a line_a] == $eof } {
-                       set end_1 1
-                       break
-                   }
-               }
-               break
-           }
-           if { [gets $file_b line_b] == $eof } {
-               set end_2 1
-               break
-           }
-       }
-
-        if { $diff_pass } {
-            break
-        } elseif { $end_1 && $end_2 } {
-            break
-        } elseif { $end_1 } {
-            send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n"
-            verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3
-            set differences 1
-            break
-        } elseif { $end_2 } {
-            send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n"
-            verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3
-            set differences 1
-            break
-        } else {
-            verbose "regexp \"^$line_b$\"\nline   \"$line_a\"" 3
-            if ![regexp "^$line_b$" "$line_a"] {
-               verbose "regexp_diff match failure\n" 3
-               send_log "regexp_diff match failure\n"
-               send_log "regexp \"^$line_b$\"\nline   \"$line_a\"\n"
-               set differences 1
-            }
-        }
-    }
-
-    if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } {
-       send_log "$file_1 and $file_2 are different lengths\n"
-       verbose "$file_1 and $file_2 are different lengths" 3
-       set differences 1
-    }
-
-    if { $fail_if_match } {
-       if { $differences == 0 } {
-           set differences 1
-       } else {
-           set differences 0
-       }
-    }
-
-    close $file_a
-    close $file_b
-
-    return $differences
-}
-
 proc file_contents { filename } {
     set file [open $filename r]
     set contents [read $file]