]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testshared: when checking for RPATHs also look for DT_RUNPATH
authorShenghou Ma <minux@golang.org>
Tue, 19 May 2015 06:48:15 +0000 (02:48 -0400)
committerMinux Ma <minux@golang.org>
Tue, 19 May 2015 23:07:45 +0000 (23:07 +0000)
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 <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testshared/shared_test.go

index 81b9dffb0775e212fb28914f97c71aa1ca4a9d58..fd577b03b5108b28bda4c3433af6d64bc3b17d8f 100644 (file)
@@ -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
+                               }
                        }
                }
        }