From c013417a45fbf950e8eb5a5e2ae37d2219c9e1d8 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 19 May 2015 02:48:15 -0400 Subject: [PATCH] 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 --- misc/cgo/testshared/shared_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 + } } } }