Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> writes: > Hi All, > > Looks like pahole fails to deduplicate BTF when kernel and > kernel module are built with gcc-14. > I see this issue with various kernel .config-s on bpf and > bpf-next trees. > I tried pahole 1.28 and the latest master. Same issues. > > BTF in bpf_testmod.ko built with gcc-14 has 2849 types. > When built with gcc-13 it has 454 types. > So something is confusing dedup logic. > Would be great if dedup experts can take a look, > since this dedup issue is breaking a lot of selftests/bpf. It does not look like the problem is with dedup. Quick glance at structure definitions does not show any duplications, just much more structs compared to clang: $ bpftool btf dump file objs-gcc/bpf_testmod.ko format raw | grep STRUCT | wc -l 351 $ bpftool btf dump file objs-clang/bpf_testmod.ko format raw | grep STRUCT | wc -l 38 Comparing raw C dumps for btf_testmod.ko it looks like much more structures are injected to distilled base, e.g. the following type is present in gcc generated .ko and is absent in clang generated: struct taskstats { long: 64; long: 64; long: 64; long: 64; ... lots of long: 64; ... } $ bpftool btf dump file objs-gcc/bpf_testmod.ko format c \ | awk '/^struct .* \{/ {s=1;c=0;o=0} \ {l=match($0, "long: 64;")} \ s && l {c++} \ s && !l {o++} \ s {print $0} \ s && /^\}/ { if (o==2 && c) print "distilled?\n"}' \ | grep 'distilled\?' | wc -l 408 $ bpftool btf dump file objs-clang/bpf_testmod.ko format c | awk ... | wc -l 33