Commit c013417a authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

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/10260Reviewed-by: default avatarMichael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 791bb4f5
......@@ -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
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment