Lines Matching defs:sym
20 static int sym_index(Elf_Sym *sym);
165 const char *name = "unknown sym type name";
181 const char *name = "unknown sym bind name";
198 const char *name = "unknown sym visibility name";
271 static const char *sym_name(const char *sym_strtab, Elf_Sym *sym)
275 if (sym->st_name) {
276 name = sym_strtab + sym->st_name;
279 name = sec_name(sym_index(sym));
292 Elf_Sym *sym;
301 for (sym = symtab; --nsyms >= 0; sym++) {
302 if (!sym->st_name)
304 if (strcmp(symname, strtab + sym->st_name) == 0)
305 return sym;
349 static int sym_index(Elf_Sym *sym)
356 if (sym->st_shndx != SHN_XINDEX)
357 return sym->st_shndx;
359 /* calculate offset of sym from head of table. */
360 offset = (unsigned long)sym - (unsigned long)symtab;
361 index = offset / sizeof(*sym);
541 Elf_Sym *sym = &sec->symtab[j];
543 sym->st_name = elf_word_to_cpu(sym->st_name);
544 sym->st_value = elf_addr_to_cpu(sym->st_value);
545 sym->st_size = elf_xword_to_cpu(sym->st_size);
546 sym->st_shndx = elf_half_to_cpu(sym->st_shndx);
614 Elf_Sym *sym;
616 sym = &sec->symtab[j];
617 name = sym_name(sym_strtab, sym);
618 if (sym->st_shndx != SHN_ABS) {
622 j, sym->st_value, sym->st_size,
623 sym_type(ELF_ST_TYPE(sym->st_info)),
624 sym_bind(ELF_ST_BIND(sym->st_info)),
625 sym_visibility(ELF_ST_VISIBILITY(sym->st_other)),
668 Elf_Sym *sym;
671 sym = &sh_symtab[ELF_R_SYM(rel->r_info)];
672 name = sym_name(sym_strtab, sym);
673 if (sym->st_shndx != SHN_ABS) {
705 sym->st_value,
730 Elf_Sym *sym, const char *symname))
753 Elf_Sym *sym = &sh_symtab[ELF_R_SYM(rel->r_info)];
754 const char *symname = sym_name(sym_strtab, sym);
756 process(sec, rel, sym, symname);
791 ElfW(Sym) *sym;
798 sym = sym_lookup("__per_cpu_load");
799 if (!sym)
803 per_cpu_load_addr = sym->st_value;
825 static int is_percpu_sym(ElfW(Sym) *sym, const char *symname)
827 int shndx = sym_index(sym);
836 static int do_reloc64(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
841 int shn_abs = (sym->st_shndx == SHN_ABS) && !is_reloc(S_REL, symname);
843 if (sym->st_shndx == SHN_UNDEF)
865 if (is_percpu_sym(sym, symname))
873 if (is_percpu_sym(sym, symname))
884 if (is_percpu_sym(sym, symname))
926 static int do_reloc32(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
930 int shn_abs = (sym->st_shndx == SHN_ABS) && !is_reloc(S_REL, symname);
940 * to be adjusted. Because sym must be defined, R_386_PLT32 can
971 static int do_reloc_real(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
975 int shn_abs = (sym->st_shndx == SHN_ABS) && !is_reloc(S_REL, symname);
985 * to be adjusted. Because sym must be defined, R_386_PLT32 can
1075 int (*do_reloc)(struct section *sec, Elf_Rel *rel, Elf_Sym *sym,
1155 static int do_reloc_info(struct section *sec, Elf_Rel *rel, ElfW(Sym) *sym,
1162 sec_name(sym_index(sym)));