diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2021-12-29 19:41:13 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2021-12-29 19:53:09 +0100 |
commit | fdbffae92a7213e9ca8c5cfbb538b2d1dd2b897a (patch) | |
tree | a3ebf30c090dd108b19df27bc6f18a6186b687b6 | |
parent | c96f0a97ce0d446635a048fb2c9f301d587fc0fd (diff) | |
download | klibc-maint-fdbffae92a7213e9ca8c5cfbb538b2d1dd2b897a.tar.gz |
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
-rwxr-xr-x | test-many-klibcs | 7 |
1 files changed, 5 insertions, 2 deletions
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 @@ run_built() { } 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() { |