Lines Matching refs:relo
3527 /* Only do relo for section with exec instructions */
3532 pr_info("elf: skipping relo section(%d) %s for section(%d) %s\n",
4062 pr_warn("prog '%s': invalid relo against '%s' for insns[%d].code 0x%x\n",
4078 pr_warn("prog '%s': extern relo failed to find extern for '%s' (%d)\n",
4102 pr_warn("prog '%s': bad call relo against '%s' in section '%s'\n",
4107 pr_warn("prog '%s': bad call relo against '%s' at offset %zu\n",
4118 pr_warn("prog '%s': invalid relo against '%s' in special section 0x%x; forgot to initialize global var?..\n",
4129 pr_warn("prog '%s': bad subprog addr relo against '%s' at offset %zu+%d\n",
4146 pr_warn("prog '%s': bad map relo against '%s' in section '%s'\n",
4162 pr_warn("prog '%s': map relo failed to find map for section '%s', off %zu\n",
4175 pr_warn("prog '%s': bad data relo against section '%s'\n",
4189 pr_warn("prog '%s': data relo failed to find map for section '%s'\n",
4270 pr_warn("sec '%s': failed to get relo #%d\n", relo_sec_name, i);
4277 pr_warn("sec '%s': symbol #%zu not found for relo #%d\n",
4283 pr_warn("sec '%s': corrupted symbol #%zu pointing to invalid section #%zu for relo #%d\n",
4289 pr_warn("sec '%s': invalid offset 0x%zx for relo #%d\n",
4307 pr_debug("sec '%s': relo #%d: insn #%u against '%s'\n",
4312 pr_debug("sec '%s': relo #%d: couldn't find program in section '%s' for insn #%u, probably overridden weak function, skipping...\n",
5708 struct reloc_desc *relos, *relo;
5714 relo = &relos[prog->nr_reloc];
5715 relo->type = RELO_CORE;
5716 relo->insn_idx = insn_idx;
5717 relo->core_relo = core_relo;
5725 struct reloc_desc *relo;
5729 relo = &prog->reloc_desc[i];
5730 if (relo->type != RELO_CORE || relo->insn_idx != insn_idx)
5733 return relo->core_relo;
5740 const struct bpf_core_relo *relo,
5751 __u32 local_id = relo->type_id;
5762 if (relo->kind != BPF_CORE_TYPE_ID_LOCAL &&
5766 pr_warn("prog '%s': relo #%d: target candidate search failed for [%d] %s %s: %ld\n",
5778 return bpf_core_calc_relo_insn(prog_name, relo, relo_idx, local_btf, cands, specs_scratch,
5863 pr_warn("prog '%s': relo #%d: failed to record relocation: %d\n",
5873 pr_warn("prog '%s': relo #%d: failed to relocate: %d\n",
5880 pr_warn("prog '%s': relo #%d: failed to patch insn #%u: %d\n",
5911 pr_debug("prog '%s': relo #%d: poisoning insn #%d that loads map #%d '%s'\n",
5939 pr_debug("prog '%s': relo #%d: poisoning insn #%d that calls kfunc '%s'\n",
5966 struct reloc_desc *relo = &prog->reloc_desc[i];
5967 struct bpf_insn *insn = &prog->insns[relo->insn_idx];
5971 switch (relo->type) {
5973 map = &obj->maps[relo->map_idx];
5976 insn[0].imm = relo->map_idx;
5981 poison_map_ldimm64(prog, i, relo->insn_idx, insn,
5982 relo->map_idx, map);
5986 map = &obj->maps[relo->map_idx];
5987 insn[1].imm = insn[0].imm + relo->sym_off;
5990 insn[0].imm = relo->map_idx;
5995 poison_map_ldimm64(prog, i, relo->insn_idx, insn,
5996 relo->map_idx, map);
6000 ext = &obj->externs[relo->ext_idx];
6022 ext = &obj->externs[relo->ext_idx];
6028 poison_kfunc_call(prog, i, relo->insn_idx, insn,
6029 relo->ext_idx, ext);
6034 pr_warn("prog '%s': relo #%d: bad insn\n",
6047 pr_warn("prog '%s': relo #%d: bad relo type %d\n",
6048 prog->name, i, relo->type);
6199 const struct reloc_desc *relo = elem;
6201 if (insn_idx == relo->insn_idx)
6203 return insn_idx < relo->insn_idx ? -1 : 1;
6250 struct reloc_desc *relo;
6262 relo = find_prog_insn_relo(prog, insn_idx);
6263 if (relo && relo->type == RELO_EXTERN_CALL)
6268 if (relo && relo->type != RELO_CALL && relo->type != RELO_SUBPROG_ADDR) {
6269 pr_warn("prog '%s': unexpected relo for insn #%zu, type %d\n",
6270 prog->name, insn_idx, relo->type);
6273 if (relo) {
6281 * for subprog addr relocation, the relo->sym_off + insn->imm is
6284 if (relo->type == RELO_CALL)
6285 sub_insn_idx = relo->sym_off / BPF_INSN_SZ + insn->imm + 1;
6287 sub_insn_idx = (relo->sym_off + insn->imm) / BPF_INSN_SZ;
6290 * RELO_SUBPROG_ADDR relo is always emitted even if both
6293 pr_warn("prog '%s': missing subprog addr relo for insn #%zu\n",
6540 * would increase and most of them will fail to find a relo.
6545 struct reloc_desc *relo = &prog->reloc_desc[j];
6546 struct bpf_insn *insn = &prog->insns[relo->insn_idx];
6549 if (relo->type == RELO_SUBPROG_ADDR)
6626 pr_warn(".maps relo #%d: failed to get ELF relo\n", i);
6632 pr_warn(".maps relo #%d: symbol %zx not found\n",
6638 pr_debug(".maps relo #%d: for %zd value %zd rel->r_offset %zu name %d ('%s')\n",
6653 pr_warn(".maps relo #%d: cannot find map '%s' at rel->r_offset %zu\n",
6663 pr_warn(".maps relo #%d: '%s' isn't a BTF-defined map\n",
6669 pr_warn(".maps relo #%d: hash-of-maps '%s' should have key size %zu.\n",
6675 pr_warn(".maps relo #%d: '%s' isn't a valid map reference\n",
6682 pr_warn(".maps relo #%d: '%s' isn't a valid program reference\n",
6689 pr_warn(".maps relo #%d: '%s' isn't an entry-point program\n",
6729 pr_debug(".maps relo #%d: map '%s' slot [%d] points to %s '%s'\n",
7118 const struct bpf_core_relo *relo;
7126 relo = find_relo_core(prog, insn_idx);
7127 if (!relo)
7130 err = bpf_core_parse_spec(prog->name, prog->obj->btf, relo, &spec);
7265 struct reloc_desc *relo = &prog->reloc_desc[i];
7266 struct extern_desc *ext = &obj->externs[relo->ext_idx];
7269 switch (relo->type) {
7277 true, kind, relo->insn_idx);
7282 relo->insn_idx);
7286 .insn_off = relo->insn_idx * 8,
7287 .type_id = relo->core_relo->type_id,
7288 .access_str_off = relo->core_relo->access_str_off,
7289 .kind = relo->core_relo->kind,