mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-18 10:56:14 +00:00
resolve_btfids: Handle presence of .BTF.base section
Now that btf_parse_elf() handles .BTF.base section presence, we need to ensure that resolve_btfids uses .BTF.base when present rather than the vmlinux base BTF passed in via the -B option. Detect .BTF.base section presence and unset the base BTF path to ensure that BTF ELF parsing will do the right thing. 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/20240613095014.357981-7-alan.maguire@oracle.com
This commit is contained in:
parent
c86f180ffc
commit
6ba77385f3
@ -409,6 +409,14 @@ static int elf_collect(struct object *obj)
|
|||||||
obj->efile.idlist = data;
|
obj->efile.idlist = data;
|
||||||
obj->efile.idlist_shndx = idx;
|
obj->efile.idlist_shndx = idx;
|
||||||
obj->efile.idlist_addr = sh.sh_addr;
|
obj->efile.idlist_addr = sh.sh_addr;
|
||||||
|
} else if (!strcmp(name, BTF_BASE_ELF_SEC)) {
|
||||||
|
/* If a .BTF.base section is found, do not resolve
|
||||||
|
* BTF ids relative to vmlinux; resolve relative
|
||||||
|
* to the .BTF.base section instead. btf__parse_split()
|
||||||
|
* will take care of this once the base BTF it is
|
||||||
|
* passed is NULL.
|
||||||
|
*/
|
||||||
|
obj->base_btf_path = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compressed_section_fix(elf, scn, &sh))
|
if (compressed_section_fix(elf, scn, &sh))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user