Hi Alan, On Tue, Dec 17, 2024 at 2:36 AM Alan Maguire <alan.maguire@xxxxxxxxxx> wrote: > > We use the DWARF location information to match a variable with its > associated ELF section. In the case of per-CPU variables their > ELF section address range starts at 0, so any 0 address variables will > appear to belong in that ELF section. However, for "discard" sections > DWARF encodes the associated variables with address location 0 so > we need to double-check that address 0 variables really are in the > associated section by checking the ELF symbol table. > > This resolves an issue exposed by CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y > kernel builds where __pcpu_* dummary variables in a .discard section > get misclassified as belonging in the per-CPU variable section since > they specify location address 0. It is _not_ your patch's fault, but I got this segfault which prevents me from testing this patch. (It also happens after reverting your patch.) INSTALL libsubcmd_headers INSTALL libsubcmd_headers CALL scripts/checksyscalls.sh UPD include/generated/utsversion.h CC init/version-timestamp.o KSYMS .tmp_vmlinux0.kallsyms.S AS .tmp_vmlinux0.kallsyms.o LD .tmp_vmlinux1 BTF .tmp_vmlinux1.btf.o Segmentation fault (core dumped) NM .tmp_vmlinux1.syms KSYMS .tmp_vmlinux1.kallsyms.S AS .tmp_vmlinux1.kallsyms.o LD .tmp_vmlinux2 NM .tmp_vmlinux2.syms KSYMS .tmp_vmlinux2.kallsyms.S AS .tmp_vmlinux2.kallsyms.o LD vmlinux BTFIDS vmlinux libbpf: failed to find '.BTF' ELF section in vmlinux FAILED: load BTF from vmlinux: No data available make[2]: *** [scripts/Makefile.vmlinux:77: vmlinux] Error 255 make[2]: *** Deleting file 'vmlinux' Thanks!