• Home
  • Raw
  • Download

Lines Matching refs:func

65 	struct symbol *func = insn->func;  in next_insn_same_func()  local
67 if (!func) in next_insn_same_func()
70 if (&next->list != &file->insn_list && next->func == func) in next_insn_same_func()
74 if (func == func->cfunc) in next_insn_same_func()
78 return find_insn(file, func->cfunc->sec, func->cfunc->offset); in next_insn_same_func()
86 if (&prev->list != &file->insn_list && prev->func == insn->func) in prev_insn_same_sym()
92 #define func_for_each_insn(file, func, insn) \ argument
93 for (insn = find_insn(file, func->sec, func->offset); \
136 if (!insn->func) in is_sibling_call()
156 static bool __dead_end_function(struct objtool_file *file, struct symbol *func, in __dead_end_function() argument
187 if (!func) in __dead_end_function()
190 if (func->bind == STB_WEAK) in __dead_end_function()
193 if (func->bind == STB_GLOBAL) in __dead_end_function()
195 if (!strcmp(func->name, global_noreturns[i])) in __dead_end_function()
198 if (!func->len) in __dead_end_function()
201 insn = find_insn(file, func->sec, func->offset); in __dead_end_function()
202 if (!insn || !insn->func) in __dead_end_function()
205 func_for_each_insn(file, func, insn) { in __dead_end_function()
220 func_for_each_insn(file, func, insn) { in __dead_end_function()
238 return __dead_end_function(file, dest->func, recursion+1); in __dead_end_function()
245 static bool dead_end_function(struct objtool_file *file, struct symbol *func) in dead_end_function() argument
247 return __dead_end_function(file, func, 0); in dead_end_function()
356 struct symbol *func; in decode_instructions() local
402 list_for_each_entry(func, &sec->symbol_list, list) { in decode_instructions()
403 if (func->type != STT_FUNC || func->alias != func) in decode_instructions()
406 if (!find_insn(file, sec, func->offset)) { in decode_instructions()
408 func->name); in decode_instructions()
412 sym_for_each_insn(file, func, insn) in decode_instructions()
413 insn->func = func; in decode_instructions()
758 struct symbol *func; in add_ignores() local
768 func = reloc->sym; in add_ignores()
772 func = find_func_by_offset(reloc->sym->sec, reloc->addend); in add_ignores()
773 if (!func) in add_ignores()
782 func_for_each_insn(file, func, insn) in add_ignores()
944 struct symbol *func; in add_uaccess_safe() local
951 func = find_symbol_by_name(file->elf, *name); in add_uaccess_safe()
952 if (!func) in add_uaccess_safe()
955 func->uaccess_safe = true; in add_uaccess_safe()
1222 } else if (insn->func) { in add_jump_destinations()
1269 if (insn->func && insn->jump_dest->func && in add_jump_destinations()
1270 insn->func != insn->jump_dest->func) { in add_jump_destinations()
1287 if (!strstr(insn->func->name, ".cold") && in add_jump_destinations()
1288 strstr(insn->jump_dest->func->name, ".cold")) { in add_jump_destinations()
1289 insn->func->cfunc = insn->jump_dest->func; in add_jump_destinations()
1290 insn->jump_dest->func->pfunc = insn->func; in add_jump_destinations()
1292 } else if (insn->jump_dest->func->pfunc != insn->func->pfunc && in add_jump_destinations()
1293 insn->jump_dest->offset == insn->jump_dest->func->offset) { in add_jump_destinations()
1295 add_call_dest(file, insn, insn->jump_dest->func, true); in add_jump_destinations()
1343 if (insn->func && insn->call_dest->type != STT_FUNC) { in add_call_destinations()
1439 nop->func = orig_insn->func; in handle_group_alt()
1459 insn->func = orig_insn->func; in handle_group_alt()
1653 struct symbol *pfunc = insn->func->pfunc; in add_jump_table()
1680 if (!dest_insn->func || dest_insn->func->pfunc != pfunc) in add_jump_table()
1708 struct symbol *func, in find_jump_table() argument
1720 insn && insn->func && insn->func->pfunc == func; in find_jump_table()
1737 if (!dest_insn || !dest_insn->func || dest_insn->func->pfunc != func) in find_jump_table()
1751 struct symbol *func) in mark_func_jump_tables() argument
1756 func_for_each_insn(file, func, insn) { in mark_func_jump_tables()
1777 reloc = find_jump_table(file, func, insn); in mark_func_jump_tables()
1786 struct symbol *func) in add_func_jump_tables() argument
1791 func_for_each_insn(file, func, insn) { in add_func_jump_tables()
1811 struct symbol *func; in add_jump_table_alts() local
1818 list_for_each_entry(func, &sec->symbol_list, list) { in add_jump_table_alts()
1819 if (func->type != STT_FUNC) in add_jump_table_alts()
1822 mark_func_jump_tables(file, func); in add_jump_table_alts()
1823 ret = add_func_jump_tables(file, func); in add_jump_table_alts()
2069 struct symbol *func; in classify_symbols() local
2072 list_for_each_entry(func, &sec->symbol_list, list) { in classify_symbols()
2073 if (func->bind != STB_GLOBAL) in classify_symbols()
2076 if (!strncmp(func->name, STATIC_CALL_TRAMP_PREFIX_STR, in classify_symbols()
2078 func->static_call_tramp = true; in classify_symbols()
2080 if (arch_is_retpoline(func)) in classify_symbols()
2081 func->retpoline_thunk = true; in classify_symbols()
2083 if (arch_is_rethunk(func)) in classify_symbols()
2084 func->return_thunk = true; in classify_symbols()
2086 if (arch_is_embedded_insn(func)) in classify_symbols()
2087 func->embedded_insn = true; in classify_symbols()
2089 if (!strcmp(func->name, "__fentry__")) in classify_symbols()
2090 func->fentry = true; in classify_symbols()
2092 if (!strncmp(func->name, "__sanitizer_cov_", 16)) in classify_symbols()
2093 func->kcov = true; in classify_symbols()
2359 if (insn->func) { in update_cfi_state()
2694 if (!no_fp && insn->func && op->src.reg == CFI_BP && in update_cfi_state()
2888 static inline bool func_uaccess_safe(struct symbol *func) in func_uaccess_safe() argument
2890 if (func) in func_uaccess_safe()
2891 return func->uaccess_safe; in func_uaccess_safe()
2904 static inline bool noinstr_call_dest(struct symbol *func) in noinstr_call_dest() argument
2910 if (!func) in noinstr_call_dest()
2916 if (func->sec->noinstr) in noinstr_call_dest()
2924 if (!strncmp(func->name, "__ubsan_handle_", 15)) in noinstr_call_dest()
2965 static int validate_return(struct symbol *func, struct instruction *insn, struct insn_state *state) in validate_return() argument
2973 if (state->uaccess && !func_uaccess_safe(func)) { in validate_return()
2979 if (!state->uaccess && func_uaccess_safe(func)) { in validate_return()
2991 if (func && has_modified_stack_frame(insn, state)) { in validate_return()
3028 static int validate_branch(struct objtool_file *file, struct symbol *func, in validate_branch() argument
3042 if (file->c_file && func && insn->func && func != insn->func->pfunc) { in validate_branch()
3044 func->name, insn->func->name); in validate_branch()
3048 if (func && insn->ignore) { in validate_branch()
3075 sym_for_each_insn_continue_reverse(file, func, i) { in validate_branch()
3122 ret = validate_branch(file, func, alt->insn, state); in validate_branch()
3145 return validate_return(func, insn, &state); in validate_branch()
3153 if (!no_fp && func && !is_special_call(insn) && in validate_branch()
3173 ret = validate_branch(file, func, in validate_branch()
3208 if (func && (!next_insn || !next_insn->hint)) { in validate_branch()
3225 if (!state.uaccess && func) { in validate_branch()
3230 if (func_uaccess_safe(func) && !state.uaccess_stack) { in validate_branch()
3248 if (!state.df && func) { in validate_branch()
3298 ret = validate_branch(file, insn->func, insn, state); in validate_unwind_hints()
3523 if (!insn->func) in ignore_unreachable_insn()
3554 insn->jump_dest->func == insn->func) { in ignore_unreachable_insn()
3562 if (insn->offset + insn->len >= insn->func->offset + insn->func->len) in ignore_unreachable_insn()
3591 ret = validate_branch(file, insn->func, insn, *state); in validate_symbol()
3600 struct symbol *func; in validate_section() local
3603 list_for_each_entry(func, &sec->symbol_list, list) { in validate_section()
3604 if (func->type != STT_FUNC) in validate_section()
3610 warnings += validate_symbol(file, sec, func, &state); in validate_section()