scripts/gdb: fix lx-symbols command for arm64 LLVM
authorKoudai Iwahori <koudai@google.com>
Tue, 1 Aug 2023 12:10:52 +0000 (05:10 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:18:58 +0000 (10:18 -0700)
commit1677bf76818beeafd4aa524ad1d031d4c760e919
treeec0861c8ffb42d8d51dd76d72cc5132df183ce19
parent29665c1e2ae56fe60dcea1135882af7d6e222ddd
scripts/gdb: fix lx-symbols command for arm64 LLVM

lx-symbols assumes that module's .text sections is located at
`module->mem[MOD_TEXT].base` and passes it to add-symbol-file command.
However, .text section follows after .plt section in modules built by LLVM
toolchain for arm64 target.  Symbol addresses are skewed in GDB.

Fix this issue by using the address of .text section stored in
`module->sect_attrs`.

Link: https://lkml.kernel.org/r/20230801121052.2475183-1-koudai@google.com
Signed-off-by: Koudai Iwahori <koudai@google.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/gdb/linux/symbols.py