aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2011-07-15 14:10:26 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2011-07-15 14:10:26 +0000
commit31f83dc55a3f0040a82d078d780bcd3efb06c5b7 (patch)
treee6a9bec62947c5b943d93ff12b24bad4d0e0b514
parent05aecedb60692c2052041d98a218c5bdcac53407 (diff)
downloadfsf-binutils-gdb-31f83dc55a3f0040a82d078d780bcd3efb06c5b7.zip
fsf-binutils-gdb-31f83dc55a3f0040a82d078d780bcd3efb06c5b7.tar.gz
fsf-binutils-gdb-31f83dc55a3f0040a82d078d780bcd3efb06c5b7.tar.bz2
* lib/gdb.exp (gdb_compile): Specify rpath if the *target* is
a remote machine, not the host. (gdb_compile_shlib): Set soname if target is remote.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/lib/gdb.exp14
2 files changed, 18 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 569f095..3befd3b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-15 Ulrich Weigand <ulrich.weigand@linaro.org>
+
+ * lib/gdb.exp (gdb_compile): Specify rpath if the *target* is
+ a remote machine, not the host.
+ (gdb_compile_shlib): Set soname if target is remote.
+
2011-07-14 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.cp/minsym-fallback.exp: Link in C++ mode.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d69527d..7ddcb13 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2168,7 +2168,7 @@ proc gdb_compile {source dest type options} {
# dynamically load one by basename, we must specify rpath. If we
# are using a remote host, DejaGNU will link to the shared library
# using a relative path, so again we must specify an rpath.
- if { $shlib_load || ($shlib_found && [is_remote host]) } {
+ if { $shlib_load || ($shlib_found && [is_remote target]) } {
if { ([istarget "*-*-mingw*"]
|| [istarget *-*-cygwin*]
|| [istarget *-*-pe*]
@@ -2383,7 +2383,17 @@ proc gdb_compile_shlib {sources dest options} {
|| [istarget *-*-cygwin*]
|| [istarget *-*-pe*])} {
lappend link_options "additional_flags=-Wl,--out-implib,${dest}.a"
- }
+ } elseif [is_remote target] {
+ # By default, we do not set the soname. This causes the linker
+ # on ELF systems to create a DT_NEEDED entry in the executable
+ # refering to the full path name of the library. This is a
+ # problem in remote testing if the library is in a different
+ # directory there. To fix this, we set a soname of just the
+ # base filename for the library, and add an appropriate -rpath
+ # to the main executable (in gdb_compile).
+ set destbase [file tail $dest]
+ lappend link_options "additional_flags=-Wl,-soname,$destbase"
+ }
}
if {[gdb_compile "${objects}" "${dest}" executable $link_options] != ""} {
return -1