On Fri, 2024-05-10 at 11:48 +0100, Alan Maguire wrote: > Adding "distilled_base" to --btf_features when generating split BTF will > create split and .BTF.base BTF - the latter allows us to map references > from split BTF to base BTF, even if that base BTF has changed. It does > this by providing just enough information about the base types in the > .BTF.base section. > > Patch is applicable on the "next" branch of dwarves, and requires the > libbpf from the series in [1] > > Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx> > > [1] https://lore.kernel.org/bpf/20240510103052.850012-1-alan.maguire@xxxxxxxxxx/ > > --- Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx> [...] > diff --git a/btf_encoder.c b/btf_encoder.c [...] > @@ -1297,7 +1298,7 @@ static int btf_encoder__write_elf(struct btf_encoder *encoder) > if (shdr == NULL) > continue; > char *secname = elf_strptr(elf, strndx, shdr->sh_name); > - if (strcmp(secname, ".BTF") == 0) { > + if (strcmp(secname, btf_secname) == 0) { Nit: comments in this function still refer to '.BTF' section. > btf_data = elf_getdata(scn, btf_data); > break; > } [...]