1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:00:21 -07:00

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 <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Shenghou Ma 2015-05-19 02:48:15 -04:00 committed by Minux Ma
parent 791bb4f5ae
commit c013417a45

View 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
}
}
}
}