mirror of
https://github.com/NixOS/patchelf.git
synced 2025-10-19 02:23:15 +08:00
24 lines
606 B
Bash
Executable File
24 lines
606 B
Bash
Executable File
#! /bin/sh -e
|
|
|
|
./simple
|
|
|
|
oldInterpreter=$(../src/patchelf --print-interpreter ./simple)
|
|
echo "current interpreter is $oldInterpreter"
|
|
|
|
rm -rf scratch
|
|
mkdir -p scratch
|
|
|
|
newInterpreter=$(pwd)/scratch/iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|
|
cp simple scratch/
|
|
../src/patchelf --set-interpreter "$newInterpreter" scratch/simple
|
|
|
|
echo "running with missing interpreter..."
|
|
if scratch/simple; then
|
|
echo "simple works, but it shouldn't"
|
|
exit 1
|
|
fi
|
|
|
|
echo "running with new interpreter..."
|
|
ln -s "$oldInterpreter" "$newInterpreter"
|
|
scratch/simple
|