ld: Add --export-dynamic-symbol and --export-dynamic-symbol-list
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / dwarf.exp
index 17a6923736996feb067991f8a518fe051677047a..4d2c35d54040c5f1a7c3f3dc1cd09bac845e91a6 100644 (file)
@@ -1,5 +1,5 @@
 # Expect script for various DWARF tests.
-#   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+#   Copyright (C) 2006-2020 Free Software Foundation, Inc.
 #
 # This file is part of the GNU Binutils.
 #
@@ -29,13 +29,14 @@ if ![is_elf_format] {
     return
 }
 
-# The following tests require running the executable generated by ld.
-if ![isnative] {
+# Skip targets where -shared is not supported
+
+if ![check_shared_lib_support] {
     return
 }
 
 # Check if compiler works
-if { [which $CC] == 0 } {
+if { ![check_compiler_available] } {
     return
 }
 
@@ -48,11 +49,17 @@ set build_tests {
   {"Build libdwarf1.so"
    "-s -shared" "-fPIC -g -feliminate-dwarf2-dups"
    {dwarf1.c} {} "libdwarf1.so"}
+  {"DWARF parse during linker error"
+   "" "-fno-toplevel-reorder"
+   {dwarf2a.c dwarf2b.c} {{error_output "dwarf2.err"}} "dwarf2.x"}
+  {"Handle no DWARF information"
+   "" "-g0"
+   {dwarf3.c} {{error_output "dwarf3.err"}} "dwarf3.x"}
 }
 
 set run_tests {
     {"Run with libdwarf1.so first"
-     "tmpdir/libdwarf1.so" ""
+     "-Wl,--no-as-needed tmpdir/libdwarf1.so" ""
      {dwarf1main.c} "dwarf1a" "dwarf1.out"
      "-g -feliminate-dwarf2-dups"}
     {"Run with libdwarf1.so last"
@@ -73,7 +80,7 @@ proc strip_test {} {
     set test_name "Strip -s $test"
     set prog $strip
 
-    if ![ld_simple_link $ld tmpdir/$test "-shared tmpdir/dwarf1.o"] {
+    if ![ld_link $ld tmpdir/$test "-shared tmpdir/dwarf1.o"] {
        unresolved "$test_name"
        return
     }
This page took 0.025049 seconds and 4 git commands to generate.