]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix new libdep test so that if the plugin cannot be located the test fails gracefully.
authorNick Clifton <nickc@redhat.com>
Thu, 27 Jun 2024 10:52:33 +0000 (11:52 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 27 Jun 2024 10:52:33 +0000 (11:52 +0100)
ld/testsuite/ld-plugin/libdep.exp

index e0afcfc342a855a9f5b28014b7552f5139b4ee24..6e56b6bab1829c00adcffd7c25acfd1223b1cde4 100644 (file)
@@ -87,20 +87,21 @@ proc run_test { } {
     set lt_objdir [regsub "objdir=" "$lt_objdir" ""]
 
     if { [ file exists "$base_dir/$lt_objdir/libdep.so" ] } {
-       set libdep "$base_dir/$lt_objdir/libdep.so"
+       set libdep_plugin "$base_dir/$lt_objdir/libdep.so"
     } else {
        # FIXME: Check in the system bfd-plugin directory ?
        fail "$testname - could not locate libdep plugin"
+       return
     }
 
-    verbose "Full plugin path: $libdep" 1
+    verbose "Full plugin path: $libdep_plugin" 1
     
     # Link the main object file with the liba.a library.
     # Use the libdep plugin to read the __.LIBDEP element in the liba.a library
     # and so bring in the libdep-b.o object file from the libc.a library.
     # Failure to locate the libc.a library, or loading the wrong libc.a library
     # will result in an unresolved reference error.
-    set exec_output [run_host_cmd "$ld" "-plugin $libdep -o libdep.exe libdep-main.o -L libdep-a -la -e 0"]
+    set exec_output [run_host_cmd "$ld" "-plugin $libdep_plugin -o libdep.exe libdep-main.o -L libdep-a -la -e 0"]
     set exec_output [prune_warnings $exec_output]
 
     set expected_output "got deps for library libdep-a/liba.a: -Llibdep-b -lc"