summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMadhavan Srinivasan <maddy@linux.ibm.com>2025-04-23 13:51:54 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-09 09:43:57 +0200
commit029f11349ec97c083a7ed97b3eeba590f91e329d (patch)
tree2482cfa9366b2fdaa17b5f46d136b40b9d488146 /arch
parent36a9a2647810e57e704dde59abdf831380ca9102 (diff)
downloadlinux-029f11349ec97c083a7ed97b3eeba590f91e329d.tar.gz
linux-029f11349ec97c083a7ed97b3eeba590f91e329d.tar.bz2
linux-029f11349ec97c083a7ed97b3eeba590f91e329d.zip
powerpc/boot: Fix dash warning
[ Upstream commit e3f506b78d921e48a00d005bea5c45ec36a99240 ] 'commit b2accfe7ca5b ("powerpc/boot: Check for ld-option support")' suppressed linker warnings, but the expressed used did not go well with POSIX shell (dash) resulting with this warning arch/powerpc/boot/wrapper: 237: [: 0: unexpected operator ld: warning: arch/powerpc/boot/zImage.epapr has a LOAD segment with RWX permissions Fix the check to handle the reported warning. Patch also fixes couple of shellcheck reported errors for the same line. In arch/powerpc/boot/wrapper line 237: if [ $(${CROSS}ld -v --no-warn-rwx-segments &>/dev/null; echo $?) -eq 0 ]; then ^-- SC2046 (warning): Quote this to prevent word splitting. ^------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC3020 (warning): In POSIX sh, &> is undefined. Fixes: b2accfe7ca5b ("powerpc/boot: Check for ld-option support") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au> Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Reviewed-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250423082154.30625-1-maddy@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rwxr-xr-xarch/powerpc/boot/wrapper2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index fea9694f1047..ddb02cf0caaf 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -234,7 +234,7 @@ fi
# suppress some warnings in recent ld versions
nowarn="-z noexecstack"
-if [ $(${CROSS}ld -v --no-warn-rwx-segments &>/dev/null; echo $?) -eq 0 ]; then
+if "${CROSS}ld" -v --no-warn-rwx-segments >/dev/null 2>&1; then
nowarn="$nowarn --no-warn-rwx-segments"
fi