Lines Matching defs:sym

860 	Elf64_Sym *sym;
867 sym = elf_sym_by_idx(obj, i);
869 if (sym->st_shndx != sec_idx)
871 if (ELF64_ST_TYPE(sym->st_info) != STT_FUNC)
874 prog_sz = sym->st_size;
875 sec_off = sym->st_value;
877 name = elf_sym_str(obj, sym->st_name);
890 if (sec_idx != obj->efile.text_shndx && ELF64_ST_BIND(sym->st_info) == STB_LOCAL) {
918 if (ELF64_ST_BIND(sym->st_info) != STB_LOCAL)
926 if (prog->sym_global && (ELF64_ST_VISIBILITY(sym->st_other) == STV_HIDDEN
927 || ELF64_ST_VISIBILITY(sym->st_other) == STV_INTERNAL))
1558 Elf64_Sym *sym = elf_sym_by_idx(obj, si);
1560 if (ELF64_ST_TYPE(sym->st_info) != STT_OBJECT)
1563 if (ELF64_ST_BIND(sym->st_info) != STB_GLOBAL &&
1564 ELF64_ST_BIND(sym->st_info) != STB_WEAK)
1567 sname = elf_sym_str(obj, sym->st_name);
1569 pr_warn("failed to get sym name string for var %s\n", name);
1573 return sym;
3080 Elf64_Sym *sym;
3099 sym = find_elf_var_sym(obj, var_name);
3100 if (IS_ERR(sym)) {
3107 vsi->offset = sym->st_value;
3116 if (ELF64_ST_VISIBILITY(sym->st_other) == STV_HIDDEN
3117 || ELF64_ST_VISIBILITY(sym->st_other) == STV_INTERNAL)
3941 static bool sym_is_extern(const Elf64_Sym *sym)
3943 int bind = ELF64_ST_BIND(sym->st_info);
3945 return sym->st_shndx == SHN_UNDEF &&
3947 ELF64_ST_TYPE(sym->st_info) == STT_NOTYPE;
3950 static bool sym_is_subprog(const Elf64_Sym *sym, int text_shndx)
3952 int bind = ELF64_ST_BIND(sym->st_info);
3953 int type = ELF64_ST_TYPE(sym->st_info);
3956 if (sym->st_shndx != text_shndx)
4183 Elf64_Sym *sym = elf_sym_by_idx(obj, i);
4185 if (!sym)
4187 if (!sym_is_extern(sym))
4189 ext_name = elf_sym_str(obj, sym->st_name);
4211 ext->is_weak = ELF64_ST_BIND(sym->st_info) == STB_WEAK;
4435 const Elf64_Sym *sym, const Elf64_Rel *rel)
4440 __u32 shdr_idx = sym->st_shndx;
4451 if (sym_is_extern(sym)) {
4466 pr_debug("prog '%s': found extern #%d '%s' (sym %d) for insn #%u\n",
4494 if (sym->st_value % BPF_INSN_SZ) {
4496 prog->name, sym_name, (size_t)sym->st_value);
4501 reloc_desc->sym_off = sym->st_value;
4512 if (sym_is_subprog(sym, obj->efile.text_shndx)) {
4513 /* global_func: sym->st_value = offset in the section, insn->imm = 0.
4514 * local_func: sym->st_value = 0, insn->imm = offset in the section.
4516 if ((sym->st_value % BPF_INSN_SZ) || (insn->imm % BPF_INSN_SZ)) {
4518 prog->name, sym_name, (size_t)sym->st_value, insn->imm);
4524 reloc_desc->sym_off = sym->st_value;
4544 map->sec_idx != sym->st_shndx ||
4545 map->sec_offset != sym->st_value)
4554 prog->name, sym_sec_name, (size_t)sym->st_value);
4560 reloc_desc->sym_off = 0; /* sym->st_value determines map_idx */
4572 if (map->libbpf_type != type || map->sec_idx != sym->st_shndx)
4588 reloc_desc->sym_off = sym->st_value;
4640 Elf64_Sym *sym;
4676 sym = elf_sym_by_idx(obj, sym_idx);
4677 if (!sym) {
4683 if (sym->st_shndx >= obj->efile.sec_cnt) {
4685 relo_sec_name, sym_idx, (size_t)sym->st_shndx, i);
4698 * in such case, symbol will be STT_SECTION and sym.st_name
4702 if (ELF64_ST_TYPE(sym->st_info) == STT_SECTION && sym->st_name == 0)
4704 sym_name = elf_sec_name(obj, elf_sec_by_idx(obj, sym->st_shndx));
4706 sym_name = elf_sec_name_by_idx(obj, sym->st_shndx);
4709 sym_name = elf_sym_str(obj, sym->st_name);
4731 insn_idx, sym_name, sym, rel);
7050 Elf64_Sym *sym;
7068 sym = elf_sym_by_idx(obj, ELF64_R_SYM(rel->r_info));
7069 if (!sym) {
7074 name = elf_sym_str(obj, sym->st_name) ?: "<?>";
7077 i, (ssize_t)(rel->r_info >> 32), (size_t)sym->st_value,
7078 (size_t)rel->r_offset, sym->st_name, name);
7100 if (sym->st_shndx != obj->efile.btf_maps_shndx) {
7124 if (targ_prog->sec_idx != sym->st_shndx ||
7125 targ_prog->sec_insn_off * 8 != sym->st_value ||
9593 Elf64_Sym *sym;
9606 sym = elf_sym_by_idx(obj, ELF64_R_SYM(rel->r_info));
9607 if (!sym) {
9613 name = elf_sym_str(obj, sym->st_name) ?: "<?>";
9622 shdr_idx = sym->st_shndx;
9627 (long long)sym->st_value,
9629 map->sec_offset, sym->st_name, name);
9636 if (sym->st_value % BPF_INSN_SZ) {
9638 map->name, (unsigned long long)sym->st_value);
9641 insn_idx = sym->st_value / BPF_INSN_SZ;