+2016-04-27  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * lib/gdb.exp (gdb_load_shlibs):  Accept a single argument.  Return
+       result of gdb_remote_download.
+       * gdb.base/ctxobj.exp: Split gdb_load_shlibs call.
+       * gdb.base/dso2dso.exp: Likewise.
+       * gdb.base/global-var-nested-by-dso.exp: Likewise.
+       * gdb.base/print-file-var.exp: Likewise.
+       * gdb.base/shlib-call.exp: Likewise.
+       * gdb.base/shreloc.exp: Likewise.
+       * gdb.base/solib-overlap.exp: Likewise.
+       * gdb.base/solib-weak.exp (do_test): Likewise.
+       * gdb.base/unload.exp: Likewise.
+
 2016-04-27  Yao Qi  <yao.qi@linaro.org>
 
        * gdb.base/branch-to-self.exp: Skip it if gdb,nosignals
 
 }
 
 clean_restart $executable
-gdb_load_shlibs $libobj1 $libobj2
+gdb_load_shlibs $libobj1
+gdb_load_shlibs $libobj2
 
 if ![runto_main] {
     untested "could not run to main"
 
 }
 
 clean_restart $binfile
-gdb_load_shlibs $binfile_libdso2 $binfile_libdso1
+gdb_load_shlibs $binfile_libdso2
+gdb_load_shlibs $binfile_libdso1
 
 if { ![runto_main] } {
   return -1
 
 }
 
 clean_restart $binfile
-gdb_load_shlibs $binfile_lib1 $binfile_lib2
+gdb_load_shlibs $binfile_lib1
+gdb_load_shlibs $binfile_lib2
 
 if { ![runto_main] } {
   return -1
 
 }
 
 clean_restart $executable
-gdb_load_shlibs $libobj1 $libobj2
+gdb_load_shlibs $libobj1
+gdb_load_shlibs $libobj2
 
 if ![runto_main] {
     untested "could not run to main"
 
 # Start with a fresh gdb.
 
 clean_restart ${binfile}
-gdb_load_shlibs $lib1 $lib2
+gdb_load_shlibs $lib1
+gdb_load_shlibs $lib2
 
 gdb_test_no_output "set print sevenbit-strings"
 gdb_test_no_output "set print address off"
 
 # Start with a fresh gdb.
 
 clean_restart $binfile
-gdb_load_shlibs $lib1_sl $lib2_sl
+gdb_load_shlibs $lib1_sl
+gdb_load_shlibs $lib2_sl
 
 # Load up the shared objects
 if ![runto_main] then {
 
 
     clean_restart ${binfile_base}
     # This testcase currently does not support remote targets.
-    # gdb_load_shlibs ${binfile_lib1} ${binfile_lib2}
+    # gdb_load_shlibs ${binfile_lib1}
+    # gdb_load_shlibs ${binfile_lib2}
 
     # Here we should get:
     # warning: .dynamic section for ".../solib-overlap-lib1.so" is not at the expected address (wrong library or version mismatch?)
 
     gdb_start
     gdb_reinitialize_dir $srcdir/$subdir
     gdb_load ${binfile}
-    gdb_load_shlibs $lib1 $lib2
+    gdb_load_shlibs $lib1
+    gdb_load_shlibs $lib2
 
     runto_main
 
 
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
-gdb_load_shlibs $lib_sl $lib_sl2
+gdb_load_shlibs $lib_sl
+gdb_load_shlibs $lib_sl2
 
 #
 # Test setting a breakpoint in a dynamically loaded library which is
 
 
 # gdb_load_shlibs LIB...
 #
-# Copy the listed libraries to the target.
+# Copy the listed library to the target.
 
-proc gdb_load_shlibs { args } {
-    foreach file $args {
-       gdb_remote_download target [shlib_target_file $file]
-    }
+proc gdb_load_shlibs { file } {
+    set dest [gdb_remote_download target [shlib_target_file $file]]
 
     if {[is_remote target]} {
        # If the target is remote, we need to tell gdb where to find the
        # We could set this even when not testing remotely, but a user
        # generally won't set it unless necessary.  In order to make the tests
        # more like the real-life scenarios, we don't set it for local testing.
-       gdb_test "set solib-search-path [file dirname [lindex $args 0]]" "" ""
+       gdb_test "set solib-search-path [file dirname $file]" "" ""
     }
+
+    return $dest
 }
 
 #