arm64 module: set plt* section addresses to 0x0
PATCH 1/1 arm64 module: set plt* section addresses to 0x0
commit f5c6d0fcf90ce07ee0d686d465b19b247ebd5ed7 upstream.
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").
---arch/arm64/include/asm/module.lds.h was renamed from arch/arm64/kernel/module.lds by commit 596b0474d3d9 ("kbuild: preprocess module linker script") since v5.10. Therefore, made same changes in arch/arm64/kernel/module.lds for 5.4.
arch/arm64/kernel/module.lds | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/kernel/module.lds +3 -3
@@ -1,5 +1,5 @@ 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) } }
Signature · 1 line
2.16.6
Quoted 16 lines · Shaoying Xu
commit
f5c6d0fcf90ce07ee0d686d465b19b247ebd5ed7upstream.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 to0x0").Reported-by Frank van der Linden <[email protected]>Signed-off-by Shaoying Xu <[email protected]>Cc <[email protected]>Signed-off-by Will Deacon <[email protected]>[[email protected]: made same changes in arch/arm64/kernel/module.lds for 5.4]Signed-off-by Shaoying Xu <[email protected]>
Quoted 4 lines
---
arch/arm64/include/asm/module.lds.hwas renamed fromarch/arm64/kernel/module.ldsby commit596b0474d3d9("kbuild: preprocess module linker script") since v5.10. Therefore, made same changes inarch/arm64/kernel/module.ldsfor 5.4.
Now queued up, thanks.
greg k-h