This commit was manufactured by cvs2svn to create branch 'binutils-
[external/binutils.git] / ld / testsuite / ld-elf / elf.exp
index 42b5541..9964ccd 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various ELF tests.
-#   Copyright 2002, 2003, 2005, 2007, 2009, 2010, 2011
+#   Copyright 2002, 2003, 2005, 2007, 2009, 2010, 2011, 2012
 #   Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
@@ -37,6 +37,13 @@ if { [istarget alpha*-*-* ] } {
     set LDFLAGS "$LDFLAGS -Ttext-segment 0x1000000"
 }
 
+if { [istarget "*-*-nacl*"] } {
+    # The eh[1-4] cases are written to expect ELFCLASS64 layout on x86-64.
+    # But the target default is ELFCLASS32.  So the cases explicitly use
+    # -melf_x86_64 to select that, but NaCl needs a different emulation name.
+    set options_regsub(ld) {-melf_x86_64 -melf_x86_64_nacl}
+}
+
 if { [is_remote host] } then {
     remote_download host merge.ld
 }
@@ -50,6 +57,20 @@ if { ![istarget hppa64*-hpux*] } {
            "" ""
            {symbol3w.s} {} "symbol3w.a"}
     }
+
+    if { [check_shared_lib_support] } then {
+       run_ld_link_tests {
+           {"Build pr14170a.o" "" "" "pr14170a.s" {} "pr14170.a" }
+       }
+       setup_xfail "tic6x-*-*"
+       run_ld_link_tests {
+           {"Build shared library for pr14170"
+               "-shared" "" "pr14170b.s" {} "pr14170.so" }
+           {"PR ld/14170"
+               "tmpdir/pr14170a.o tmpdir/pr14170.so" "" "pr14170c.s"
+               { } "pr14170" }
+       }
+    }
 }
 
 # Run a test to check linking a shared library with a broken linker
@@ -59,14 +80,15 @@ if { ![istarget hppa64*-hpux*] } {
 #
 # Only run the test on targets thats support creating shared libraries.
 if { [check_shared_lib_support] } then {
-  run_ld_link_tests {
-      {"Build shared library for next test"
-       "-shared" "" "note-3.s" {} "note-3.so" }
-      {"Link using broken linker script"
-        "--script note-3.t tmpdir/note-3.so" "" ""
-         { { ld "note-3.l" } }
-         "a.out" }
-  }
+    setup_xfail "tic6x-*-*"
+    run_ld_link_tests {
+       {"Build shared library for next test"
+           "-shared" "" "note-3.s" {} "note-3.so" }
+       {"Link using broken linker script"
+           "--script note-3.t tmpdir/note-3.so" "" ""
+           { { ld "note-3.l" } }
+           "a.out" }
+    }
 }
 
 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
@@ -77,6 +99,7 @@ foreach t $test_list {
 }
 
 if { [istarget *-*-linux*]
+     || [istarget *-*-nacl*]
      || [istarget *-*-gnu*] } {
     run_ld_link_tests {
        {"Weak symbols in dynamic objects 1 (support)"
@@ -136,6 +159,7 @@ set xfails [list "*-*-netbsdelf*"]
 run_ld_link_exec_tests $xfails $array_tests
 
 if { [istarget *-*-linux*]
+     || [istarget *-*-nacl*]
      || [istarget *-*-gnu*] } {
     run_ld_link_exec_tests $xfails $array_tests_pie
 }