Respect a possibly prefixed readelf

...i case of cross-compiling. Already done for other tests with
07bbf47e9c.
This commit is contained in:
Heiko Becker
2023-04-24 21:57:32 +02:00
parent 99c2423898
commit d0c418fe38

View File

@@ -2,6 +2,7 @@
SCRATCH=scratch/$(basename "$0" .sh)
PATCHELF=$(readlink -f "../src/patchelf")
READELF=${READELF:-readelf}
rm -rf "${SCRATCH}"
mkdir -p "${SCRATCH}"
@@ -18,7 +19,7 @@ ${PATCHELF} --add-needed ./libbar.so simple
# Test that repeatedly modifying a string inside a shared library does not
# corrupt it due to the addition of multiple PT_LOAD entries
###############################################################################
load_segments_before=$(readelf -W -l libbar.so | grep -c LOAD)
load_segments_before=$(${READELF} -W -l libbar.so | grep -c LOAD)
for _ in $(seq 1 100)
do
@@ -27,7 +28,7 @@ do
./simple || exit 1
done
load_segments_after=$(readelf -W -l libbar.so | grep -c LOAD)
load_segments_after=$(${READELF} -W -l libbar.so | grep -c LOAD)
###############################################################################
# To be even more strict, check that we don't add too many extra LOAD entries