]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - scripts/faddr2line
scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1
authorWill Deacon <will@kernel.org>
Mon, 2 Oct 2023 16:57:48 +0000 (17:57 +0100)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Mon, 23 Oct 2023 15:36:33 +0000 (08:36 -0700)
commit86bf86e19d308a1dba41e5f1f7e8cc105a5efa49
tree919a1de519de630ca7e5ad420df59d2c888227a9
parent180af1a5bdaf8d4964837a46a9fce8c3a7fd2d97
scripts/faddr2line: Use LLVM addr2line and readelf if LLVM=1

GNU utilities cannot necessarily parse objects built by LLVM, which can
result in confusing errors when using 'faddr2line':

$ CROSS_COMPILE=aarch64-linux-gnu- ./scripts/faddr2line vmlinux do_one_initcall+0xf4/0x260
aarch64-linux-gnu-addr2line: vmlinux: unknown type [0x13] section `.relr.dyn'
aarch64-linux-gnu-addr2line: DWARF error: invalid or unhandled FORM value: 0x25
do_one_initcall+0xf4/0x260:
aarch64-linux-gnu-addr2line: vmlinux: unknown type [0x13] section `.relr.dyn'
aarch64-linux-gnu-addr2line: DWARF error: invalid or unhandled FORM value: 0x25
$x.73 at main.c:?

Although this can be worked around by setting CROSS_COMPILE to "llvm=-",
it's cleaner to follow the same syntax as the top-level Makefile and
accept LLVM= as an indication to use the llvm- tools, optionally
specifying their location or specific version number.

Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20231002165750.1661-3-will@kernel.org
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
scripts/faddr2line