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