mirror of
https://github.com/NixOS/patchelf.git
synced 2025-10-18 17:42:36 +08:00
Respect a possibly prefixed readelf
...i case of cross-compiling. Already done for other tests with
07bbf47e9c
.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
SCRATCH=scratch/$(basename "$0" .sh)
|
SCRATCH=scratch/$(basename "$0" .sh)
|
||||||
PATCHELF=$(readlink -f "../src/patchelf")
|
PATCHELF=$(readlink -f "../src/patchelf")
|
||||||
|
READELF=${READELF:-readelf}
|
||||||
|
|
||||||
rm -rf "${SCRATCH}"
|
rm -rf "${SCRATCH}"
|
||||||
mkdir -p "${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
|
# Test that repeatedly modifying a string inside a shared library does not
|
||||||
# corrupt it due to the addition of multiple PT_LOAD entries
|
# 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)
|
for _ in $(seq 1 100)
|
||||||
do
|
do
|
||||||
@@ -27,7 +28,7 @@ do
|
|||||||
./simple || exit 1
|
./simple || exit 1
|
||||||
done
|
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
|
# To be even more strict, check that we don't add too many extra LOAD entries
|
||||||
|
Reference in New Issue
Block a user