+if { ![istarget hppa64*-hpux*] } {
+ run_ld_link_tests {
+ {"Build symbol3.a"
+ "" "" ""
+ {symbol3.s} {} "symbol3.a"}
+ {"Build symbol3w.a"
+ "" "" ""
+ {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" }
+ }
+ }
+}
+
+# Only run these tests on targets thats support creating shared libraries.
+if { [check_shared_lib_support] } then {
+ # Run a test to check linking a shared library with a broken linker
+ # script that accidentally marks dynamic sections as notes. The
+ # resulting executable is not expected to work, but the linker
+ # should not seg-fault whilst creating the binary.
+ 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" }
+ }
+ setup_xfail "tic6x-*-*"
+ run_ld_link_tests {
+ {"Build pr17068.so"
+ "-shared" "" ""
+ {pr17068d.s} {} "pr17068.so"}
+ {"Build pr17068a.a"
+ "" "" ""
+ {pr17068a.s pr17068c.s pr17068ez.s} {} "pr17068a.a"}
+ {"Build pr17068b.a"
+ "" "" ""
+ {pr17068b.s pr17068e.s} {} "pr17068b.a"}
+ {"pr17068 link --as-needed lib in group"
+ "--as-needed" "--start-group tmpdir/pr17068a.a tmpdir/pr17068.so tmpdir/pr17068b.a --end-group" ""
+ {start.s pr17068.s} {} "pr17068"}
+ }
+}
+