Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: fix build when CONFIG_DEBUG_INFO_BTF[_MODULES] is undefined

Kernel test robot reports that kernel build fails with
resilient split BTF changes.

Examining the associated config and code we see that
btf_relocate_id() is defined under CONFIG_DEBUG_INFO_BTF_MODULES.
Moving it outside the #ifdef solves the issue.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202406221742.d2srFLVI-lkp@intel.com/
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/r/20240623135224.27981-1-alan.maguire@oracle.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Alan Maguire and committed by
Alexei Starovoitov
5a532459 04efaebd

+2 -2
+2 -2
kernel/bpf/btf.c
··· 6185 6185 return btf; 6186 6186 } 6187 6187 6188 - #ifdef CONFIG_DEBUG_INFO_BTF_MODULES 6189 - 6190 6188 /* If .BTF_ids section was created with distilled base BTF, both base and 6191 6189 * split BTF ids will need to be mapped to actual base/split ids for 6192 6190 * BTF now that it has been relocated. ··· 6195 6197 return id; 6196 6198 return btf->base_id_map[id]; 6197 6199 } 6200 + 6201 + #ifdef CONFIG_DEBUG_INFO_BTF_MODULES 6198 6202 6199 6203 static struct btf *btf_parse_module(const char *module_name, const void *data, 6200 6204 unsigned int data_size, void *base_data,