Lines Matching defs:sym

117 #define sym_for_each_insn(file, sym, insn)				\
118 for (insn = find_insn(file, sym->sec, sym->offset); \
119 insn && insn->offset < sym->offset + sym->len; \
122 #define sym_for_each_insn_continue_reverse(file, sym, insn) \
124 insn && insn->offset >= sym->offset; \
468 insn->sym = func;
494 struct symbol *sym, *func;
499 sym = find_symbol_by_name(file->elf, symname);
500 if (!sym)
503 off = sym->offset;
504 end = off + sym->len;
506 reloc = find_reloc_by_dest_range(file->elf, sym->sec, off, end - off);
510 func = reloc->sym;
512 func = find_symbol_by_offset(reloc->sym->sec,
515 idx = (reloc_offset(reloc) - sym->offset) / sizeof(unsigned long);
540 struct symbol *sym;
548 sym = find_symbol_by_name(file->elf, "pv_ops");
549 if (!sym)
552 nr = sym->len / sizeof(unsigned long);
598 if (reloc->sym->type != STT_SECTION) {
605 insn = find_insn(file, reloc->sym->sec, addend);
608 else if (addend == reloc->sym->sec->sh.sh_size) {
609 insn = find_last_insn(file, reloc->sym->sec);
612 reloc->sym->sec->name, addend);
617 reloc->sym->sec->name, addend);
637 if (reloc->sym->type != STT_SECTION) {
644 insn = find_insn(file, reloc->sym->sec, addend);
647 else if (addend == reloc->sym->sec->sh.sh_size) {
648 insn = find_last_insn(file, reloc->sym->sec);
651 reloc->sym->sec->name, addend);
656 reloc->sym->sec->name, addend);
865 struct symbol *sym = insn->sym;
868 if (opts.module && sym && sym->type == STT_FUNC &&
869 insn->offset == sym->offset &&
870 (!strcmp(sym->name, "init_module") ||
871 !strcmp(sym->name, "cleanup_module")))
872 WARN("%s(): not an indirect call target", sym->name);
888 struct symbol *sym;
899 for_each_sym(file, sym) {
900 if (sym->type != STT_FUNC)
903 if (strncmp(sym->name, "__cfi_", 6))
915 for_each_sym(file, sym) {
916 if (sym->type != STT_FUNC)
919 if (strncmp(sym->name, "__cfi_", 6))
924 sym->sec, sym->offset))
1033 switch (reloc->sym->type) {
1035 func = reloc->sym;
1039 func = find_func_by_offset(reloc->sym->sec, reloc_addend(reloc));
1046 rsec->name, reloc->sym->type);
1274 if (reloc->sym->type != STT_SECTION) {
1279 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
1295 __weak bool arch_is_retpoline(struct symbol *sym)
1304 __weak bool arch_is_rethunk(struct symbol *sym)
1313 __weak bool arch_is_embedded_insn(struct symbol *sym)
1353 struct symbol *sym = insn_call_dest(insn);
1355 if (!sym)
1356 sym = reloc->sym;
1367 if (sym->static_call_tramp) {
1372 if (sym->retpoline_thunk) {
1382 if (opts.hack_noinstr && insn->sec->noinstr && sym->profiling_func) {
1406 if (opts.mcount && sym->fentry) {
1427 if (!sibling && dead_end_function(file, sym))
1498 struct instruction *insn, struct symbol *sym)
1500 if (insn->offset == sym->offset)
1508 insn->offset == sym->offset + prev->len)
1522 struct symbol *fs = from->sym;
1523 struct symbol *ts = to->sym;
1566 } else if (reloc->sym->type == STT_SECTION) {
1567 dest_sec = reloc->sym->sec;
1569 } else if (reloc->sym->retpoline_thunk) {
1572 } else if (reloc->sym->return_thunk) {
1580 add_call_dest(file, insn, reloc->sym, true);
1582 } else if (reloc->sym->sec->idx) {
1583 dest_sec = reloc->sym->sec;
1584 dest_off = reloc->sym->sym.st_value +
1593 struct symbol *sym = find_symbol_by_offset(dest_sec, dest_off);
1603 if (sym && sym->embedded_insn) {
1701 } else if (reloc->sym->type == STT_SECTION) {
1703 dest = find_call_destination(reloc->sym->sec, dest_off);
1706 reloc->sym->sec->name, dest_off);
1712 } else if (reloc->sym->retpoline_thunk) {
1716 add_call_dest(file, insn, reloc->sym, false);
1800 nop->sym = orig_insn->sym;
1820 insn->sym = orig_insn->sym;
2027 if (reloc->sym->sec == pfunc->sec &&
2031 dest_insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
2092 dest_insn = find_insn(file, table_reloc->sym->sec, reloc_addend(table_reloc));
2238 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
2263 struct symbol *sym = find_symbol_by_offset(insn->sec, insn->offset);
2265 if (sym && sym->bind == STB_GLOBAL) {
2306 insn = find_insn(file, reloc->sym->sec,
2307 reloc->sym->offset + reloc_addend(reloc));
2330 if (reloc->sym->type != STT_SECTION) {
2335 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
2366 if (reloc->sym->type != STT_SECTION) {
2371 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
2385 if (reloc->sym->type != STT_SECTION) {
2390 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
2413 if (reloc->sym->type != STT_SECTION) {
2418 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
2443 if (reloc->sym->type != STT_SECTION) {
2449 insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
3360 if (reloc && !strcmp(reloc->sym->name, "pv_ops")) {
3376 if (!reloc || strcmp(reloc->sym->name, "pv_ops"))
4185 struct symbol *sym, struct insn_state *state)
4190 if (!sym->len) {
4191 WARN("%s() is missing an ELF size annotation", sym->name);
4195 if (sym->pfunc != sym || sym->alias != sym)
4198 insn = find_insn(file, sec, sym->offset);
4202 state->uaccess = sym->uaccess_safe;
4206 BT_INSN(insn, "<=== (sym)");
4278 struct symbol *sym = find_symbol_containing(insn->sec, insn->offset-1);
4281 if (!sym)
4284 first = find_insn(file, sym->sec, sym->offset);
4291 return insn->offset == sym->offset + sym->len;
4329 if (reloc->sym->static_call_tramp)
4332 off = reloc->sym->offset;
4339 dest = find_insn(file, reloc->sym->sec, off);
4394 dest = find_insn(file, reloc->sym->sec,
4395 reloc->sym->offset + reloc_addend(reloc));
4524 insn->sym->warned = 1;
4614 struct symbol *sym;
4617 for_each_sym(file, sym) {
4618 if (sym->warned) {
4620 funcs = malloc(strlen(sym->name) + 1);
4621 strcpy(funcs, sym->name);
4623 tmp = malloc(strlen(funcs) + strlen(sym->name) + 2);
4624 sprintf(tmp, "%s %s", funcs, sym->name);