* [PATCH] powerpc/boot: Check for ld-option support
@ 2025-04-01 0:42 Madhavan Srinivasan
2025-04-01 7:57 ` Venkat Rao Bagalkote
2025-04-21 9:41 ` Madhavan Srinivasan
0 siblings, 2 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2025-04-01 0:42 UTC (permalink / raw)
To: mpe, npiggin, christophe.leroy
Cc: naveen, linuxppc-dev, Madhavan Srinivasan, Venkat Rao Bagalkote
Commit 579aee9fc594 ("powerpc: suppress some linker warnings in recent linker versions")
enabled support to add linker option "--no-warn-rwx-segments",
if the version is greater than 2.39. Similar build warning were
reported recently from linker version 2.35.2.
ld: warning: arch/powerpc/boot/zImage.epapr has a LOAD segment with RWX permissions
ld: warning: arch/powerpc/boot/zImage.pseries has a LOAD segment with RWX permissions
Fix the warning by checking for "--no-warn-rwx-segments"
option support in linker to enable it, instead of checking
for the version range.
Fixes: Commit 579aee9fc594 ("powerpc: suppress some linker warnings in recent linker versions")
Closes: https://lore.kernel.org/linuxppc-dev/61cf556c-4947-4bd6-af63-892fc0966dad@linux.ibm.com/
Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
arch/powerpc/boot/wrapper | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 1db60fe13802..267ca6d4d9b3 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -234,10 +234,8 @@ fi
# suppress some warnings in recent ld versions
nowarn="-z noexecstack"
-if ! ld_is_lld; then
- if [ "$LD_VERSION" -ge "$(echo 2.39 | ld_version)" ]; then
- nowarn="$nowarn --no-warn-rwx-segments"
- fi
+if [ $(${CROSS}ld -v --no-warn-rwx-segments &>/dev/null; echo $?) -eq 0 ]; then
+ nowarn="$nowarn --no-warn-rwx-segments"
fi
platformo=$object/"$platform".o
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/boot: Check for ld-option support
2025-04-01 0:42 [PATCH] powerpc/boot: Check for ld-option support Madhavan Srinivasan
@ 2025-04-01 7:57 ` Venkat Rao Bagalkote
2025-04-21 9:41 ` Madhavan Srinivasan
1 sibling, 0 replies; 3+ messages in thread
From: Venkat Rao Bagalkote @ 2025-04-01 7:57 UTC (permalink / raw)
To: linuxppc-dev
On 01/04/25 6:12 am, Madhavan Srinivasan wrote:
> Commit 579aee9fc594 ("powerpc: suppress some linker warnings in recent linker versions")
> enabled support to add linker option "--no-warn-rwx-segments",
> if the version is greater than 2.39. Similar build warning were
> reported recently from linker version 2.35.2.
>
> ld: warning: arch/powerpc/boot/zImage.epapr has a LOAD segment with RWX permissions
> ld: warning: arch/powerpc/boot/zImage.pseries has a LOAD segment with RWX permissions
>
> Fix the warning by checking for "--no-warn-rwx-segments"
> option support in linker to enable it, instead of checking
> for the version range.
>
> Fixes: Commit 579aee9fc594 ("powerpc: suppress some linker warnings in recent linker versions")
> Closes: https://lore.kernel.org/linuxppc-dev/61cf556c-4947-4bd6-af63-892fc0966dad@linux.ibm.com/
> Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
> ---
> arch/powerpc/boot/wrapper | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
> index 1db60fe13802..267ca6d4d9b3 100755
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -234,10 +234,8 @@ fi
>
> # suppress some warnings in recent ld versions
> nowarn="-z noexecstack"
> -if ! ld_is_lld; then
> - if [ "$LD_VERSION" -ge "$(echo 2.39 | ld_version)" ]; then
> - nowarn="$nowarn --no-warn-rwx-segments"
> - fi
> +if [ $(${CROSS}ld -v --no-warn-rwx-segments &>/dev/null; echo $?) -eq 0 ]; then
> + nowarn="$nowarn --no-warn-rwx-segments"
> fi
>
> platformo=$object/"$platform".o
Tested this patch, by applying on main-line kernel with commit HEAD:
1a9239bb4253f9076b5b4b2a1a4e8d7defd77a95, and no build warnings are
observed.
Please add below tag:
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Regards,
Venkat.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc/boot: Check for ld-option support
2025-04-01 0:42 [PATCH] powerpc/boot: Check for ld-option support Madhavan Srinivasan
2025-04-01 7:57 ` Venkat Rao Bagalkote
@ 2025-04-21 9:41 ` Madhavan Srinivasan
1 sibling, 0 replies; 3+ messages in thread
From: Madhavan Srinivasan @ 2025-04-21 9:41 UTC (permalink / raw)
To: mpe, npiggin, christophe.leroy, Madhavan Srinivasan
Cc: naveen, linuxppc-dev, Venkat Rao Bagalkote
On Tue, 01 Apr 2025 06:12:18 +0530, Madhavan Srinivasan wrote:
> Commit 579aee9fc594 ("powerpc: suppress some linker warnings in recent linker versions")
> enabled support to add linker option "--no-warn-rwx-segments",
> if the version is greater than 2.39. Similar build warning were
> reported recently from linker version 2.35.2.
>
> ld: warning: arch/powerpc/boot/zImage.epapr has a LOAD segment with RWX permissions
> ld: warning: arch/powerpc/boot/zImage.pseries has a LOAD segment with RWX permissions
>
> [...]
Applied to powerpc/fixes.
[1/1] powerpc/boot: Check for ld-option support
https://git.kernel.org/powerpc/c/b2accfe7ca5bc9f9af28e603b79bdd5ad8df5c0b
Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-21 9:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 0:42 [PATCH] powerpc/boot: Check for ld-option support Madhavan Srinivasan
2025-04-01 7:57 ` Venkat Rao Bagalkote
2025-04-21 9:41 ` Madhavan Srinivasan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).