From: Shenghou Ma Date: Tue, 19 May 2015 06:48:15 +0000 (-0400) Subject: misc/cgo/testshared: when checking for RPATHs also look for DT_RUNPATH X-Git-Tag: go1.5beta1~520 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c013417a45fbf950e8eb5a5e2ae37d2219c9e1d8;p=gostls13.git misc/cgo/testshared: when checking for RPATHs also look for DT_RUNPATH On my systems, ld -rpath sets DT_RUNPATH instead of DT_RPATH. Change-Id: I5047e795fb7ef9336f5fa13ba24bb6245c0b0582 Reviewed-on: https://go-review.googlesource.com/10260 Reviewed-by: Michael Hudson-Doyle Reviewed-by: Ian Lance Taylor --- diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index 81b9dffb07..fd577b03b5 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -192,10 +192,12 @@ func AssertIsLinkedTo(t *testing.T, path, lib string) { } func AssertHasRPath(t *testing.T, path, dir string) { - for _, dynstring := range dynStrings(path, elf.DT_RPATH) { - for _, rpath := range strings.Split(dynstring, ":") { - if filepath.Clean(rpath) == filepath.Clean(dir) { - return + for _, tag := range []elf.DynTag{elf.DT_RPATH, elf.DT_RUNPATH} { + for _, dynstring := range dynStrings(path, tag) { + for _, rpath := range strings.Split(dynstring, ":") { + if filepath.Clean(rpath) == filepath.Clean(dir) { + return + } } } }