* [PATCH] arm64 module: set plt* section addresses to 0x0
@ 2021-02-16 18:32 Shaoying Xu
2021-02-16 18:38 ` Shaoying Xu
2021-02-19 19:16 ` Will Deacon
0 siblings, 2 replies; 3+ messages in thread
From: Shaoying Xu @ 2021-02-16 18:32 UTC (permalink / raw)
To: catalin.marinas, will
Cc: benh, fllinden, linux-kernel, linux-arm-kernel, shaoyi
These plt* and .text.ftrace_trampoline sections specified for arm64 have
non-zero addressses. Non-zero section addresses in a relocatable ELF would
confuse GDB when it tries to compute the section offsets and it ends up
printing wrong symbol addresses. Therefore, set them to zero, which mirrors
the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section
addresses to 0x0").
Reported-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
Cc: stable@vger.kernel.org
---
arch/arm64/include/asm/module.lds.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h
index 691f15af788e..810045628c66 100644
--- a/arch/arm64/include/asm/module.lds.h
+++ b/arch/arm64/include/asm/module.lds.h
@@ -1,7 +1,7 @@
#ifdef CONFIG_ARM64_MODULE_PLTS
SECTIONS {
- .plt (NOLOAD) : { BYTE(0) }
- .init.plt (NOLOAD) : { BYTE(0) }
- .text.ftrace_trampoline (NOLOAD) : { BYTE(0) }
+ .plt 0 (NOLOAD) : { BYTE(0) }
+ .init.plt 0 (NOLOAD) : { BYTE(0) }
+ .text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) }
}
#endif
--
2.16.6
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64 module: set plt* section addresses to 0x0
2021-02-16 18:32 [PATCH] arm64 module: set plt* section addresses to 0x0 Shaoying Xu
@ 2021-02-16 18:38 ` Shaoying Xu
2021-02-19 19:16 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Shaoying Xu @ 2021-02-16 18:38 UTC (permalink / raw)
To: catalin.marinas, will
Cc: benh, fllinden, linux-kernel, linux-arm-kernel, shaoyi
So sorry about the double send because I forgot to cc the lists. Please just
ignore the first one. Thank you!
On Tue, Feb 16, 2021 at 06:32:34PM +0000, Shaoying Xu wrote:
> These plt* and .text.ftrace_trampoline sections specified for arm64 have
> non-zero addressses. Non-zero section addresses in a relocatable ELF would
> confuse GDB when it tries to compute the section offsets and it ends up
> printing wrong symbol addresses. Therefore, set them to zero, which mirrors
> the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section
> addresses to 0x0").
>
> Reported-by: Frank van der Linden <fllinden@amazon.com>
> Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
> Cc: stable@vger.kernel.org
> ---
> arch/arm64/include/asm/module.lds.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm64/include/asm/module.lds.h b/arch/arm64/include/asm/module.lds.h
> index 691f15af788e..810045628c66 100644
> --- a/arch/arm64/include/asm/module.lds.h
> +++ b/arch/arm64/include/asm/module.lds.h
> @@ -1,7 +1,7 @@
> #ifdef CONFIG_ARM64_MODULE_PLTS
> SECTIONS {
> - .plt (NOLOAD) : { BYTE(0) }
> - .init.plt (NOLOAD) : { BYTE(0) }
> - .text.ftrace_trampoline (NOLOAD) : { BYTE(0) }
> + .plt 0 (NOLOAD) : { BYTE(0) }
> + .init.plt 0 (NOLOAD) : { BYTE(0) }
> + .text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) }
> }
> #endif
> --
> 2.16.6
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64 module: set plt* section addresses to 0x0
2021-02-16 18:32 [PATCH] arm64 module: set plt* section addresses to 0x0 Shaoying Xu
2021-02-16 18:38 ` Shaoying Xu
@ 2021-02-19 19:16 ` Will Deacon
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2021-02-19 19:16 UTC (permalink / raw)
To: Shaoying Xu, catalin.marinas
Cc: benh, kernel-team, fllinden, linux-kernel, Will Deacon, linux-arm-kernel
On Tue, 16 Feb 2021 18:32:34 +0000, Shaoying Xu wrote:
> These plt* and .text.ftrace_trampoline sections specified for arm64 have
> non-zero addressses. Non-zero section addresses in a relocatable ELF would
> confuse GDB when it tries to compute the section offsets and it ends up
> printing wrong symbol addresses. Therefore, set them to zero, which mirrors
> the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section
> addresses to 0x0").
Applied to arm64 (for-next/fixes), thanks!
[1/1] arm64 module: set plt* section addresses to 0x0
https://git.kernel.org/arm64/c/f5c6d0fcf90c
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-19 19:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 18:32 [PATCH] arm64 module: set plt* section addresses to 0x0 Shaoying Xu
2021-02-16 18:38 ` Shaoying Xu
2021-02-19 19:16 ` Will Deacon
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).