Lines Matching refs:subprog
5957 /* When __weak subprog is "overridden" by another instance
5958 * of the subprog from a different object file, linker still
5963 * subprog instructions when discovering subprograms.
6217 struct bpf_program *subprog;
6257 subprog = find_prog_by_sec_insn(obj, obj->efile.text_shndx, sub_insn_idx);
6258 if (!subprog) {
6265 * subprogram (meaning this subprog hasn't been processed
6274 if (subprog->sub_insn_off == 0) {
6275 subprog->sub_insn_off = main_prog->insns_cnt;
6277 new_cnt = main_prog->insns_cnt + subprog->insns_cnt;
6286 memcpy(main_prog->insns + subprog->sub_insn_off, subprog->insns,
6287 subprog->insns_cnt * sizeof(*insns));
6290 main_prog->name, subprog->insns_cnt, subprog->name);
6292 err = bpf_object__reloc_code(obj, main_prog, subprog);
6304 * well), so position of any subprog can be different for
6306 insn->imm = subprog->sub_insn_off - (prog->sub_insn_off + insn_idx) - 1;
6311 pr_debug("prog '%s': insn #%zu relocated, imm %d points to subprog '%s' (now at %zu offset)\n",
6312 prog->name, insn_idx, insn->imm, subprog->name, subprog->sub_insn_off);
6322 * main prog) is processed separately. For each subprog (non-entry functions,
6327 * where given subprog was appended. This will further be used to relocate all
6328 * the call instructions jumping into this subprog.
6331 * is into a subprog that hasn't been processed (i.e., subprog->sub_insn_off
6332 * is zero), subprog instructions are appended at the end of main program's
6336 * the *main* prog's instructions (subprog's instructions are always left
6338 * and subprog instructions are always sent only as part of a main prog) and
6343 * desired target subprog.
6347 * subprog->sub_insn_off as zero at all times and won't be appended to current
6402 struct bpf_program *subprog;
6409 subprog = &obj->programs[i];
6410 if (!prog_is_subprog(obj, subprog))
6413 subprog->sub_insn_off = 0;
6414 for (j = 0; j < subprog->nr_reloc; j++)
6415 if (subprog->reloc_desc[j].type == RELO_CALL)
6416 subprog->reloc_desc[j].processed = false;