On Mon, Oct 26, 2020 at 1:22 PM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote: > > Em Mon, Oct 26, 2020 at 05:10:06PM -0300, Arnaldo Carvalho de Melo escreveu: > > Now with a correct subject :-) > > > > Em Mon, Oct 26, 2020 at 04:58:30PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Hi guys, > > > > > > I just stumbled on this, investigating... This is with what is > > > in the tmp branch at > > > git://git.kernel.org/pub/scm/devel/pahole/pahole.git. > > > > > > error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type > > > Encountered error while encoding BTF. > > > LD .tmp_vmlinux.kallsyms1 > > > KSYMS .tmp_vmlinux.kallsyms1.S > > > AS .tmp_vmlinux.kallsyms1.S > > > LD .tmp_vmlinux.kallsyms2 > > > KSYMS .tmp_vmlinux.kallsyms2.S > > > AS .tmp_vmlinux.kallsyms2.S > > > LD vmlinux > > > BTFIDS vmlinux > > > FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255 > > > make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+' > > > make: *** [Makefile:185: __sub-make] Error 2 > > > > It is something recent: > > > > c815d26689313d8d7 (Hao Luo 2020-08-24 17:45:23 -0700 440) if (var->ip.tag.type == 0) { > > 2e719cca667212840 (Andrii Nakryiko 2020-10-08 16:39:57 -0700 441) fprintf(stderr, "error: found variable in CU '%s' that has void type\n", > > 2e719cca667212840 (Andrii Nakryiko 2020-10-08 16:39:57 -0700 442) cu->name); > > f3d9054ba8ff1df0f (Hao Luo 2020-07-08 13:44:10 -0700 443) if (force) > > f3d9054ba8ff1df0f (Hao Luo 2020-07-08 13:44:10 -0700 444) continue; > > f3d9054ba8ff1df0f (Hao Luo 2020-07-08 13:44:10 -0700 445) err = -1; > > f3d9054ba8ff1df0f (Hao Luo 2020-07-08 13:44:10 -0700 446) break; > > Printing the variable name and address gives: > > LD .tmp_vmlinux.btf > BTF .btf.vmlinux.bin.o > error: found variable "(null)" (addr: 0xffffffff82f4e260) in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type > Encountered error while encoding BTF. > > Unsure if this is related: > > [root@five ~]# gcc --version | head -1 > gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1) > [root@five ~]# > > [acme@five linux]$ readelf -sw ../build/v5.9.0+/vmlinux | grep ffffffff82f4e260 > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large > > <SNIP lots more such lines> > Don't know what this is, but what Hao proposed (to check everything only after we make sure that the variable has a proper per-CPU symbol in ELF) would eliminate all that, so I think we should do just that. But I'm surprised I didn't see any of those issues in my kernel configurations and environment (though I use GCC 8, still, so that might explain). > - Arnaldo