Lines Matching defs:relo

3853 			/* Only do relo for section with exec instructions */
3860 pr_info("elf: skipping relo section(%d) %s for section(%d) %s\n",
4390 pr_warn("prog '%s': invalid relo against '%s' for insns[%d].code 0x%x\n",
4406 pr_warn("prog '%s': extern relo failed to find extern for '%s' (%d)\n",
4430 pr_warn("prog '%s': bad call relo against '%s' in section '%s'\n",
4435 pr_warn("prog '%s': bad call relo against '%s' at offset %zu\n",
4446 pr_warn("prog '%s': invalid relo against '%s' in special section 0x%x; forgot to initialize global var?..\n",
4457 pr_warn("prog '%s': bad subprog addr relo against '%s' at offset %zu+%d\n",
4483 pr_warn("prog '%s': bad map relo against '%s' in section '%s'\n",
4499 pr_warn("prog '%s': map relo failed to find map for section '%s', off %zu\n",
4512 pr_warn("prog '%s': bad data relo against section '%s'\n",
4526 pr_warn("prog '%s': data relo failed to find map for section '%s'\n",
4607 pr_warn("sec '%s': failed to get relo #%d\n", relo_sec_name, i);
4614 pr_warn("sec '%s': symbol #%zu not found for relo #%d\n",
4620 pr_warn("sec '%s': corrupted symbol #%zu pointing to invalid section #%zu for relo #%d\n",
4626 pr_warn("sec '%s': invalid offset 0x%zx for relo #%d\n",
4644 pr_debug("sec '%s': relo #%d: insn #%u against '%s'\n",
4649 pr_debug("sec '%s': relo #%d: couldn't find program in section '%s' for insn #%u, probably overridden weak function, skipping...\n",
5693 struct reloc_desc *relos, *relo;
5699 relo = &relos[prog->nr_reloc];
5700 relo->type = RELO_CORE;
5701 relo->insn_idx = insn_idx;
5702 relo->core_relo = core_relo;
5710 struct reloc_desc *relo;
5714 relo = &prog->reloc_desc[i];
5715 if (relo->type != RELO_CORE || relo->insn_idx != insn_idx)
5718 return relo->core_relo;
5725 const struct bpf_core_relo *relo,
5736 __u32 local_id = relo->type_id;
5747 if (relo->kind != BPF_CORE_TYPE_ID_LOCAL &&
5751 pr_warn("prog '%s': relo #%d: target candidate search failed for [%d] %s %s: %ld\n",
5763 return bpf_core_calc_relo_insn(prog_name, relo, relo_idx, local_btf, cands, specs_scratch,
5848 pr_warn("prog '%s': relo #%d: failed to record relocation: %d\n",
5858 pr_warn("prog '%s': relo #%d: failed to relocate: %d\n",
5865 pr_warn("prog '%s': relo #%d: failed to patch insn #%u: %d\n",
5896 pr_debug("prog '%s': relo #%d: poisoning insn #%d that loads map #%d '%s'\n",
5924 pr_debug("prog '%s': relo #%d: poisoning insn #%d that calls kfunc '%s'\n",
5951 struct reloc_desc *relo = &prog->reloc_desc[i];
5952 struct bpf_insn *insn = &prog->insns[relo->insn_idx];
5956 switch (relo->type) {
5958 map = &obj->maps[relo->map_idx];
5961 insn[0].imm = relo->map_idx;
5966 poison_map_ldimm64(prog, i, relo->insn_idx, insn,
5967 relo->map_idx, map);
5971 map = &obj->maps[relo->map_idx];
5972 insn[1].imm = insn[0].imm + relo->sym_off;
5975 insn[0].imm = relo->map_idx;
5980 poison_map_ldimm64(prog, i, relo->insn_idx, insn,
5981 relo->map_idx, map);
5985 ext = &obj->externs[relo->ext_idx];
6007 ext = &obj->externs[relo->ext_idx];
6013 poison_kfunc_call(prog, i, relo->insn_idx, insn,
6014 relo->ext_idx, ext);
6019 pr_warn("prog '%s': relo #%d: bad insn\n",
6032 pr_warn("prog '%s': relo #%d: bad relo type %d\n",
6033 prog->name, i, relo->type);
6184 const struct reloc_desc *relo = elem;
6186 if (insn_idx == relo->insn_idx)
6188 return insn_idx < relo->insn_idx ? -1 : 1;
6266 struct reloc_desc *relo;
6279 relo = find_prog_insn_relo(prog, insn_idx);
6280 if (relo && relo->type == RELO_EXTERN_CALL)
6285 if (relo && relo->type != RELO_CALL && relo->type != RELO_SUBPROG_ADDR) {
6286 pr_warn("prog '%s': unexpected relo for insn #%zu, type %d\n",
6287 prog->name, insn_idx, relo->type);
6290 if (relo) {
6298 * for subprog addr relocation, the relo->sym_off + insn->imm is
6301 if (relo->type == RELO_CALL)
6302 sub_insn_idx = relo->sym_off / BPF_INSN_SZ + insn->imm + 1;
6304 sub_insn_idx = (relo->sym_off + insn->imm) / BPF_INSN_SZ;
6307 * RELO_SUBPROG_ADDR relo is always emitted even if both
6310 pr_warn("prog '%s': missing subprog addr relo for insn #%zu\n",
6939 * would increase and most of them will fail to find a relo.
6944 struct reloc_desc *relo = &prog->reloc_desc[j];
6945 struct bpf_insn *insn = &prog->insns[relo->insn_idx];
6948 if (relo->type == RELO_SUBPROG_ADDR)
7056 pr_warn(".maps relo #%d: failed to get ELF relo\n", i);
7062 pr_warn(".maps relo #%d: symbol %zx not found\n",
7068 pr_debug(".maps relo #%d: for %zd value %zd rel->r_offset %zu name %d ('%s')\n",
7083 pr_warn(".maps relo #%d: cannot find map '%s' at rel->r_offset %zu\n",
7093 pr_warn(".maps relo #%d: '%s' isn't a BTF-defined map\n",
7099 pr_warn(".maps relo #%d: hash-of-maps '%s' should have key size %zu.\n",
7105 pr_warn(".maps relo #%d: '%s' isn't a valid map reference\n",
7112 pr_warn(".maps relo #%d: '%s' isn't a valid program reference\n",
7119 pr_warn(".maps relo #%d: '%s' isn't an entry-point program\n",
7159 pr_debug(".maps relo #%d: map '%s' slot [%d] points to %s '%s'\n",
7552 const struct bpf_core_relo *relo;
7560 relo = find_relo_core(prog, insn_idx);
7561 if (!relo)
7564 err = bpf_core_parse_spec(prog->name, prog->obj->btf, relo, &spec);
7699 struct reloc_desc *relo = &prog->reloc_desc[i];
7700 struct extern_desc *ext = &obj->externs[relo->ext_idx];
7703 switch (relo->type) {
7711 true, kind, relo->insn_idx);
7716 relo->insn_idx);
7720 .insn_off = relo->insn_idx * 8,
7721 .type_id = relo->core_relo->type_id,
7722 .access_str_off = relo->core_relo->access_str_off,
7723 .kind = relo->core_relo->kind,