]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: Add helper to read .note.gnu.build-id section
authorLucas De Marchi <demarchi@kernel.org>
Wed, 25 Mar 2026 04:34:28 +0000 (23:34 -0500)
committerLucas De Marchi <demarchi@kernel.org>
Sat, 20 Jun 2026 16:09:52 +0000 (11:09 -0500)
commitbbbfcd8f3d9640b17ca51cc1bc68615da34dbe18
tree75282531046d2bd5d02e022130365fffb23f0148
parent0da79e0ab322298e2af0bd754b5970f2fd474dce
libkmod: Add helper to read .note.gnu.build-id section

Read the .note.gnu.build-id section so it can be displayed by modinfo in
a future change. For now this is only added to pretty-print the id, but
later can be refactored to easily compare with the section dump from
/sys/module/<module-name>/.note.gnu.build-id

The section in the elf is potentially available since kernel 4.10 (if
toolchain supports it) and became unconditional since commit
89ff7131f78a ("kbuild: add --hash-style= and --build-id unconditionally")
since minimum toolchain versions got raised.

Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/432
libkmod/libkmod-elf.c
libkmod/libkmod-internal.h