# 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,
#
# 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.
#
#
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
}
{"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"
}
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
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
}