test-many-klibcs: Don't patch longer interpreter name into test execs
Patching in a longer interpreter name may cause the base load address
to be lower, which results in failure to map the executable on some
architectures.
Shorten the name by:
- Creating a symlink "k.so" in the build directory to klibc.so
- Using the relative filename of k.so
diff --git a/test-many-klibcs b/test-many-klibcs
index 13ddce2..3f33e0b 100755
--- a/test-many-klibcs
+++ b/test-many-klibcs
@@ -78,8 +78,11 @@
}
patch_interp() {
- patchelf --set-interpreter "$PWD/build/$tools-$toolsarch/usr/klibc/klibc.so" \
- "$@"
+ # Patching in a longer interpreter name can break things, so
+ # use a short-ish relative filename
+ test -L "build/$tools-$toolsarch/k.so" \
+ || ln -s usr/klibc/klibc.so "build/$tools-$toolsarch/k.so"
+ patchelf --set-interpreter "build/$tools-$toolsarch/k.so" "$@"
}
run_test_program() {