ld: Hide symbols defined by HIDDEN/PROVIDE_HIDDEN
[deliverable/binutils-gdb.git] / ld / testsuite / ld-elf / dwarf.exp
index b10e3d256c79adfa0db5e9c637cd8f362a21c56f..975654c463c50126f24b2504fc67d61412cf8f2d 100644 (file)
@@ -1,9 +1,11 @@
 # Expect script for various DWARF tests.
-#   Copyright 2006 Free Software Foundation, Inc.
+#   Copyright (C) 2006-2018 Free Software Foundation, Inc.
 #
-# This file is free software; you can redistribute it and/or modify
+# This file is part of the GNU Binutils.
+#
+# 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
@@ -13,7 +15,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
 #
 
 #
@@ -26,8 +29,9 @@ 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
 }
 
@@ -45,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"
@@ -59,7 +69,7 @@ set run_tests {
 }
 
 run_cc_link_tests $build_tests
-run_ld_link_exec_tests [] $run_tests
+run_ld_link_exec_tests $run_tests
 
 proc strip_test {} {
     global ld
@@ -70,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.024253 seconds and 4 git commands to generate.