# Expect script for various ELF tests.
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
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
}
{"Run with shared with --audit"
"-shared -Wl,--audit=tmpdir/audit.so" "-fPIC"
{main.c} {} "libusesaudit.so"}
- {"Run with shared with --audit"
+ {"Run with shared with three --audit"
"-shared -Wl,--audit=tmpdir/audit.so -Wl,--audit=tmpdir/audit2.so \
-Wl,--audit=tmpdir/audit3.so"
"-fPIC"
{"Run with -lusesaudit -lusesaudit2"
"-Ltmpdir/ -lusesaudit -lusesaudit2" ""
{main.c} {{"readelf" {-d} "depaudit2.rd"}} "useslibusesaudit2.out"}
+ {"Link with -z globalaudit"
+ "-Wl,-Paudit.so -Wl,-z,globalaudit" ""
+ {main.c} {{"readelf" {-d} "globalaudit.rd"}} "globalaudit.out"}
}
run_cc_link_tests $build_tests