]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/testsuite/ld-elf/audit.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-elf / audit.exp
index b278ec1750d71181ef82b7dd7d0efcae54b1a6c9..2b3850dbf3d464c5a7afa2bf60457e7922ae7229 100644 (file)
@@ -1,5 +1,5 @@
 # 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.
 #
@@ -25,13 +25,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,7 +49,7 @@ set build_tests {
   {"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"
@@ -59,6 +60,9 @@ set build_tests {
   {"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