Lines Matching refs:kdesc

586 	struct ksym_desc *kdesc;  in get_ksym_desc()  local
590 kdesc = &gen->ksyms[i]; in get_ksym_desc()
591 if (kdesc->kind == relo->kind && kdesc->is_ld64 == relo->is_ld64 && in get_ksym_desc()
592 !strcmp(kdesc->name, relo->name)) { in get_ksym_desc()
593 kdesc->ref++; in get_ksym_desc()
594 return kdesc; in get_ksym_desc()
597 kdesc = libbpf_reallocarray(gen->ksyms, gen->nr_ksyms + 1, sizeof(*kdesc)); in get_ksym_desc()
598 if (!kdesc) { in get_ksym_desc()
602 gen->ksyms = kdesc; in get_ksym_desc()
603 kdesc = &gen->ksyms[gen->nr_ksyms++]; in get_ksym_desc()
604 kdesc->name = relo->name; in get_ksym_desc()
605 kdesc->kind = relo->kind; in get_ksym_desc()
606 kdesc->ref = 1; in get_ksym_desc()
607 kdesc->off = 0; in get_ksym_desc()
608 kdesc->insn = 0; in get_ksym_desc()
609 kdesc->is_ld64 = relo->is_ld64; in get_ksym_desc()
610 return kdesc; in get_ksym_desc()
666 struct ksym_desc *kdesc; in emit_relo_kfunc_btf() local
669 kdesc = get_ksym_desc(gen, relo); in emit_relo_kfunc_btf()
670 if (!kdesc) in emit_relo_kfunc_btf()
673 if (kdesc->ref > 1) { in emit_relo_kfunc_btf()
675 kdesc->insn + offsetof(struct bpf_insn, imm)); in emit_relo_kfunc_btf()
677 kdesc->insn + offsetof(struct bpf_insn, off)); in emit_relo_kfunc_btf()
681 kdesc->insn = insn; in emit_relo_kfunc_btf()
693 kdesc->off = btf_fd_idx; in emit_relo_kfunc_btf()
727 relo->name, kdesc->ref); in emit_relo_kfunc_btf()
729 0, 0, 0, blob_fd_array_off(gen, kdesc->off))); in emit_relo_kfunc_btf()
732 relo->name, kdesc->ref); in emit_relo_kfunc_btf()
757 struct ksym_desc *kdesc; in emit_relo_ksym_typeless() local
759 kdesc = get_ksym_desc(gen, relo); in emit_relo_ksym_typeless()
760 if (!kdesc) in emit_relo_ksym_typeless()
763 if (kdesc->ref > 1) { in emit_relo_ksym_typeless()
765 kdesc->insn + offsetof(struct bpf_insn, imm)); in emit_relo_ksym_typeless()
767 kdesc->insn + sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm)); in emit_relo_ksym_typeless()
771 kdesc->insn = insn; in emit_relo_ksym_typeless()
773 kdesc->typeless = true; in emit_relo_ksym_typeless()
784 emit_ksym_relo_log(gen, relo, kdesc->ref); in emit_relo_ksym_typeless()
803 struct ksym_desc *kdesc; in emit_relo_ksym_btf() local
806 kdesc = get_ksym_desc(gen, relo); in emit_relo_ksym_btf()
807 if (!kdesc) in emit_relo_ksym_btf()
810 if (kdesc->ref > 1) { in emit_relo_ksym_btf()
812 kdesc->insn + sizeof(struct bpf_insn) + offsetof(struct bpf_insn, imm)); in emit_relo_ksym_btf()
814 kdesc->insn + offsetof(struct bpf_insn, imm)); in emit_relo_ksym_btf()
822 kdesc->insn = insn; in emit_relo_ksym_btf()
848 emit_ksym_relo_log(gen, relo, kdesc->ref); in emit_relo_ksym_btf()
904 struct ksym_desc *kdesc; in cleanup_relos() local
908 kdesc = &gen->ksyms[i]; in cleanup_relos()
910 if (kdesc->is_ld64 && !kdesc->typeless) { in cleanup_relos()
912 insn = kdesc->insn; in cleanup_relos()
915 } else if (!kdesc->is_ld64) { in cleanup_relos()
916 emit_sys_close_blob(gen, blob_fd_array_off(gen, kdesc->off)); in cleanup_relos()
917 if (kdesc->off < MAX_FD_ARRAY_SZ) in cleanup_relos()