summaryrefslogtreecommitdiff
path: root/tests/set-rpath-library.sh
diff options
context:
space:
mode:
authorBreno Rodrigues GuimarĂ£es <brenorg@gmail.com>2023-03-11 10:59:27 -0300
committerGitHub <noreply@github.com>2023-03-11 10:59:27 -0300
commitac212d0e6fb8b741e5a5e9ea61091149103f401c (patch)
treea93853a74f4a168d00849b7cfdb3c9732e34ee44 /tests/set-rpath-library.sh
parentea2fca765c440fff1ff74e1463444dea7b819db2 (diff)
parent80f68669368ecfaac342077eb70109fb3c5d0ac7 (diff)
downloadpatchelf-ac212d0e6fb8b741e5a5e9ea61091149103f401c.tar.gz
Merge pull request #475 from brenoguim/breno.474
Use the largest segment alignment for libraries requiring non-standard alignments #474
Diffstat (limited to 'tests/set-rpath-library.sh')
-rwxr-xr-xtests/set-rpath-library.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/set-rpath-library.sh b/tests/set-rpath-library.sh
index 55661a1..6ae1715 100755
--- a/tests/set-rpath-library.sh
+++ b/tests/set-rpath-library.sh
@@ -14,6 +14,7 @@ mkdir -p "${SCRATCH}/libsB"
cp main-scoped "${SCRATCH}/"
cp libfoo-scoped.so "${SCRATCH}/libsA/"
cp libbar-scoped.so "${SCRATCH}/libsB/"
+cp liboveralign.so "${SCRATCH}/"
oldRPath=$(../src/patchelf --print-rpath "${SCRATCH}"/main-scoped)
if test -z "$oldRPath"; then oldRPath="/oops"; fi
@@ -56,3 +57,12 @@ if test "$exitCode" != 46; then
echo "bad exit code!"
exit 1
fi
+
+# ALL loads should have the same alignment
+lib="${SCRATCH}/liboveralign.so"
+../src/patchelf --set-rpath "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "$lib"
+num_alignments=$(${READELF} -W -l "${lib}" | awk '/LOAD/ { print $NF }' | sort -u | wc -l)
+echo "$num_alignments"
+if test "${num_alignments}" -ne "1"; then
+ exit 1
+fi