]> www.infradead.org Git - nvme.git/commit
kbuild,bpf: Add module-specific pahole flags for distilled base BTF
authorAlan Maguire <alan.maguire@oracle.com>
Thu, 20 Jun 2024 09:17:32 +0000 (10:17 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 21 Jun 2024 21:45:07 +0000 (14:45 -0700)
commit46fb0b62ea29c0dbcb3e44f1d67aafe79bc6e045
treeee099472310e53d874ad531b3747d3ea760a1293
parent8646db238997df36c6ad71a9d7e0b52ceee221b2
kbuild,bpf: Add module-specific pahole flags for distilled base BTF

Support creation of module BTF along with distilled base BTF;
the latter is stored in a .BTF.base ELF section and supplements
split BTF references to base BTF with information about base types,
allowing for later relocation of split BTF with a (possibly
changed) base.  resolve_btfids detects the presence of a .BTF.base
section and will use it instead of the base BTF it is passed in
BTF id resolution.

Modules will be built with a distilled .BTF.base section for external
module build, i.e.

make -C. -M=path2/module

...while in-tree module build as part of a normal kernel build will
not generate distilled base BTF; this is because in-tree modules
change with the kernel and do not require BTF relocation for the
running vmlinux.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20240620091733.1967885-6-alan.maguire@oracle.com
scripts/Makefile.btf
scripts/Makefile.modfinal