From 9f1c0af97b947687d3f916e10baa405b11d57584 Mon Sep 17 00:00:00 2001 From: Breno Rodrigues Guimaraes Date: Tue, 7 Mar 2023 18:46:25 -0300 Subject: Set the alignment of the new LOAD segment the same as others --- tests/set-rpath-library.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/set-rpath-library.sh') diff --git a/tests/set-rpath-library.sh b/tests/set-rpath-library.sh index 55661a1..55a4c16 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}" | grep LOAD | awk '{ print $NF }' | sort -u | wc -l) +echo "$num_alignments" +if test "${num_alignments}" -ne "1"; then + exit 1 +fi -- cgit v1.2.1 From 80f68669368ecfaac342077eb70109fb3c5d0ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Breno=20Rodrigues=20Guimar=C3=A3es?= Date: Wed, 8 Mar 2023 16:35:12 -0300 Subject: Filter with awk instead of grep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- tests/set-rpath-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/set-rpath-library.sh') diff --git a/tests/set-rpath-library.sh b/tests/set-rpath-library.sh index 55a4c16..6ae1715 100755 --- a/tests/set-rpath-library.sh +++ b/tests/set-rpath-library.sh @@ -61,7 +61,7 @@ fi # ALL loads should have the same alignment lib="${SCRATCH}/liboveralign.so" ../src/patchelf --set-rpath "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "$lib" -num_alignments=$(${READELF} -W -l "${lib}" | grep LOAD | awk '{ print $NF }' | sort -u | wc -l) +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 -- cgit v1.2.1