Skip to content

Commit dc6fc15

Browse files
committed
Use patchelf in glibc_run
1 parent 38d5669 commit dc6fc15

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

glibc_run.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ if [ ! -e "$VERSION/libc-$1.so" ]; then
1313
echo "./build_glibc $1 <#make-threads"
1414
fi
1515

16-
LD_PRELOAD="$VERSION/libc-$1.so" "$VERSION/ld-$1.so" "$2"
16+
curr_interp=$(readelf -l "$2" | grep 'Requesting' | cut -d':' -f2 | tr -d ' ]')
17+
target_interp="$VERSION/ld-$1.so"
18+
19+
if [[ $curr_interp != $target_interp ]];
20+
then
21+
patchelf --set-interpreter "$target_interp" "$2"
22+
fi
23+
24+
LD_PRELOAD="$VERSION/libc-$1.so" "$2"

0 commit comments

Comments
 (0)