[PATCH v6][makedumpfile 02/10] Implement kernel kallsyms resolving

HAGIO KAZUHITO(萩尾 一仁) k-hagio-ab at nec.com
Thu Jun 18 01:27:54 PDT 2026


Hi Tao,

On 2026/06/17 14:18, Tao Liu wrote:
> This patch will parse kernel's kallsyms data. During the parsing
> process, the .init_ksyms sections of makedumpfile and the
> extensions will be iterated, so the kallsyms symbols which belongs
> to vmlinux can be resolved at this moment.
> 
> Reviewed-by: Stephen Brennan <stephen.s.brennan at oracle.com>
> Signed-off-by: Tao Liu <ltao at redhat.com>
> ---
>   Makefile       |   2 +-
>   kallsyms.c     | 392 +++++++++++++++++++++++++++++++++++++++++++++++++
>   kallsyms.h     |  83 +++++++++++
>   makedumpfile.c |   3 +
>   makedumpfile.h |  11 ++
>   5 files changed, 490 insertions(+), 1 deletion(-)
>   create mode 100644 kallsyms.c
>   create mode 100644 kallsyms.h
> 
> diff --git a/Makefile b/Makefile
> index 9482332..3cd729f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -45,7 +45,7 @@ CFLAGS_ARCH += -m32
>   endif
>   
>   SRC_BASE = makedumpfile.c makedumpfile.h diskdump_mod.h sadump_mod.h sadump_info.h
> -SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c tools.c printk.c detect_cycle.c
> +SRC_PART = print_info.c dwarf_info.c elf_info.c erase_info.c sadump_info.c cache.c tools.c printk.c detect_cycle.c kallsyms.c
>   OBJ_PART=$(patsubst %.c,%.o,$(SRC_PART))
>   SRC_ARCH = arch/arm.c arch/arm64.c arch/x86.c arch/x86_64.c arch/ia64.c arch/ppc64.c arch/s390x.c arch/ppc.c arch/sparc64.c arch/mips64.c arch/loongarch64.c arch/riscv64.c
>   OBJ_ARCH=$(patsubst %.c,%.o,$(SRC_ARCH))
> diff --git a/kallsyms.c b/kallsyms.c
> new file mode 100644
> index 0000000..a55dcc6
> --- /dev/null
> +++ b/kallsyms.c
> @@ -0,0 +1,392 @@
> +#define _GNU_SOURCE

Just for confirmation, is this for what?  I can build without this line.

$ git grep _GNU_SOURCE
kallsyms.c:#define _GNU_SOURCE

If unnecessary, I would not like to add something new for compatibility.
is it ok to remove this when merging?

Thanks,
Kazu


More information about the kexec mailing list