On Sun, Dec 12, 2021 at 5:07 PM Andrii Nakryiko <andrii@xxxxxxxxxx> wrote: > > During linking, type IDs in the resulting linked BPF object file can > change, and so ldimm64 instructions corresponding to > BPF_CORE_TYPE_ID_TARGET and BPF_CORE_TYPE_ID_LOCAL CO-RE relos can get > their imm value out of sync with actual CO-RE relocation information > that's updated by BPF linker properly during linking process. > > We could teach BPF linker to adjust such instructions, but it feels > a bit too much for linker to re-implement good chunk of > bpf_core_patch_insns logic just for this. This is a redundant safety > check for TYPE_ID relocations, as the real validation is in matching > CO-RE specs, so if that works fine, it's very unlikely that there is > something wrong with the instruction itself. > > So, instead, teach libbpf (and kernel) to ignore insn->imm for > BPF_CORE_TYPE_ID_TARGET and BPF_CORE_TYPE_ID_LOCAL relos. > > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Applied. Thanks for the quick fix. bpf-next CI should be green again.