FROMGIT: tools: Add gendwarfksyms

Add a basic DWARF parser, which uses libdw to traverse the debugging
information in an object file and looks for functions and variables.
In follow-up patches, this will be expanded to produce symbol versions
for CONFIG_MODVERSIONS from DWARF.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit f28568841ae0a0dd48dfc5400aaebedf10a54d10
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Bug: 347787665
Signed-off-by: Matthew Maurer <mmaurer@google.com>

Change-Id: I2635541b5ab5dd93356e3ceedb83985132338a0e
Signed-off-by: Matthew Maurer <mmaurer@google.com>
This commit is contained in:
Sami Tolvanen
2025-01-03 20:45:23 +00:00
committed by Giuliano Procida
parent b0c7496af3
commit cf4c955a9c
9 changed files with 513 additions and 0 deletions
+8
View File
@@ -169,6 +169,14 @@ config MODVERSIONS
make them incompatible with the kernel you are running. If
unsure, say N.
config GENDWARFKSYMS
bool "gendwarfksyms (from debugging information)"
depends on DEBUG_INFO
# Requires full debugging information, split DWARF not supported.
depends on !DEBUG_INFO_REDUCED && !DEBUG_INFO_SPLIT
# Requires ELF object files.
depends on !LTO
config ASM_MODVERSIONS
bool
default HAVE_ASM_MODVERSIONS && MODVERSIONS