Lines Matching refs:subprog

4123 	/* loading subprog addresses */
4129 pr_warn("prog '%s': bad subprog addr relo against '%s' at offset %zu+%d\n",
5834 /* When __weak subprog is "overridden" by another instance
5835 * of the subprog from a different object file, linker still
5840 * subprog instructions when discovering subprograms.
6214 static int append_subprog_relos(struct bpf_program *main_prog, struct bpf_program *subprog)
6216 int new_cnt = main_prog->nr_reloc + subprog->nr_reloc;
6220 if (main_prog == subprog)
6229 if (subprog->nr_reloc)
6230 memcpy(relos + main_prog->nr_reloc, subprog->reloc_desc,
6231 sizeof(*relos) * subprog->nr_reloc);
6234 relos[i].insn_idx += subprog->sub_insn_off;
6248 struct bpf_program *subprog;
6281 * for subprog addr relocation, the relo->sym_off + insn->imm is
6293 pr_warn("prog '%s': missing subprog addr relo for insn #%zu\n",
6307 subprog = find_prog_by_sec_insn(obj, obj->efile.text_shndx, sub_insn_idx);
6308 if (!subprog) {
6315 * subprogram (meaning this subprog hasn't been processed
6324 if (subprog->sub_insn_off == 0) {
6325 subprog->sub_insn_off = main_prog->insns_cnt;
6327 new_cnt = main_prog->insns_cnt + subprog->insns_cnt;
6336 memcpy(main_prog->insns + subprog->sub_insn_off, subprog->insns,
6337 subprog->insns_cnt * sizeof(*insns));
6340 main_prog->name, subprog->insns_cnt, subprog->name);
6342 /* The subprog insns are now appended. Append its relos too. */
6343 err = append_subprog_relos(main_prog, subprog);
6346 err = bpf_object__reloc_code(obj, main_prog, subprog);
6358 * well), so position of any subprog can be different for
6361 insn->imm = subprog->sub_insn_off - (prog->sub_insn_off + insn_idx) - 1;
6363 pr_debug("prog '%s': insn #%zu relocated, imm %d points to subprog '%s' (now at %zu offset)\n",
6364 prog->name, insn_idx, insn->imm, subprog->name, subprog->sub_insn_off);
6374 * main prog) is processed separately. For each subprog (non-entry functions,
6379 * where given subprog was appended. This will further be used to relocate all
6380 * the call instructions jumping into this subprog.
6383 * is into a subprog that hasn't been processed (i.e., subprog->sub_insn_off
6384 * is zero), subprog instructions are appended at the end of main program's
6388 * the *main* prog's instructions (subprog's instructions are always left
6390 * and subprog instructions are always sent only as part of a main prog) and
6395 * desired target subprog.
6399 * subprog->sub_insn_off as zero at all times and won't be appended to current
6454 struct bpf_program *subprog;
6461 subprog = &obj->programs[i];
6462 if (!prog_is_subprog(obj, subprog))
6465 subprog->sub_insn_off = 0;
6558 * Append subprog relos to main programs to allow data relos to be