Lines Matching refs:reloc

443 	struct reloc *reloc;  in add_dead_ends()  local
461 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
462 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
466 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
469 else if (reloc->addend == reloc->sym->sec->len) { in add_dead_ends()
470 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
473 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
478 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
496 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
497 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
501 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
504 else if (reloc->addend == reloc->sym->sec->len) { in add_dead_ends()
505 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
508 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
513 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
754 struct reloc *reloc; in add_ignores() local
760 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignores()
761 switch (reloc->sym->type) { in add_ignores()
763 func = reloc->sym; in add_ignores()
767 func = find_func_by_offset(reloc->sym->sec, reloc->addend); in add_ignores()
773 WARN("unexpected relocation symbol type in %s: %d", sec->name, reloc->sym->type); in add_ignores()
951 struct reloc *reloc; in add_ignore_alternatives() local
958 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignore_alternatives()
959 if (reloc->sym->type != STT_SECTION) { in add_ignore_alternatives()
964 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_ignore_alternatives()
988 static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) in insn_reloc()
990 if (insn->reloc == NEGATIVE_RELOC) in insn_reloc()
993 if (!insn->reloc) { in insn_reloc()
994 insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec, in insn_reloc()
996 if (!insn->reloc) { in insn_reloc()
997 insn->reloc = NEGATIVE_RELOC; in insn_reloc()
1002 return insn->reloc; in insn_reloc()
1018 struct reloc *reloc = insn_reloc(file, insn); in annotate_call_site() local
1022 sym = reloc->sym; in annotate_call_site()
1049 if (reloc) { in annotate_call_site()
1050 reloc->type = R_NONE; in annotate_call_site()
1051 elf_write_reloc(file->elf, reloc); in annotate_call_site()
1179 struct reloc *reloc; in add_jump_destinations() local
1187 reloc = insn_reloc(file, insn); in add_jump_destinations()
1188 if (!reloc) { in add_jump_destinations()
1191 } else if (reloc->sym->type == STT_SECTION) { in add_jump_destinations()
1192 dest_sec = reloc->sym->sec; in add_jump_destinations()
1193 dest_off = arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
1194 } else if (reloc->sym->retpoline_thunk) { in add_jump_destinations()
1197 } else if (reloc->sym->return_thunk) { in add_jump_destinations()
1202 add_call_dest(file, insn, reloc->sym, true); in add_jump_destinations()
1204 } else if (reloc->sym->sec->idx) { in add_jump_destinations()
1205 dest_sec = reloc->sym->sec; in add_jump_destinations()
1206 dest_off = reloc->sym->sym.st_value + in add_jump_destinations()
1207 arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
1307 struct reloc *reloc; in add_call_destinations() local
1313 reloc = insn_reloc(file, insn); in add_call_destinations()
1314 if (!reloc) { in add_call_destinations()
1334 } else if (reloc->sym->type == STT_SECTION) { in add_call_destinations()
1335 dest_off = arch_dest_reloc_offset(reloc->addend); in add_call_destinations()
1336 dest = find_call_destination(reloc->sym->sec, dest_off); in add_call_destinations()
1338 if (is_cfi_section(reloc->sym->sec)) in add_call_destinations()
1343 reloc->sym->sec->name, in add_call_destinations()
1350 } else if (reloc->sym->retpoline_thunk) { in add_call_destinations()
1354 add_call_dest(file, insn, reloc->sym, false); in add_call_destinations()
1439 struct reloc *alt_reloc; in handle_group_alt()
1604 struct reloc *table) in add_jump_table()
1606 struct reloc *reloc = table; in add_jump_table() local
1616 list_for_each_entry_from(reloc, &table->sec->reloc_list, list) { in add_jump_table()
1619 if (reloc != table && reloc->jump_table_start) in add_jump_table()
1623 if (prev_offset && reloc->offset != prev_offset + 8) in add_jump_table()
1627 if (reloc->sym->sec == pfunc->sec && in add_jump_table()
1628 reloc->addend == pfunc->offset) in add_jump_table()
1631 dest_insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_jump_table()
1647 prev_offset = reloc->offset; in add_jump_table()
1663 static struct reloc *find_jump_table(struct objtool_file *file, in find_jump_table()
1667 struct reloc *table_reloc; in find_jump_table()
1710 struct reloc *reloc; in mark_func_jump_tables() local
1733 reloc = find_jump_table(file, func, insn); in mark_func_jump_tables()
1734 if (reloc) { in mark_func_jump_tables()
1735 reloc->jump_table_start = true; in mark_func_jump_tables()
1736 insn->jump_table = reloc; in mark_func_jump_tables()
1802 struct reloc *reloc; in read_unwind_hints() local
1809 relocsec = sec->reloc; in read_unwind_hints()
1825 reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint)); in read_unwind_hints()
1826 if (!reloc) { in read_unwind_hints()
1831 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_unwind_hints()
1891 struct reloc *reloc; in read_retpoline_hints() local
1897 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_retpoline_hints()
1898 if (reloc->sym->type != STT_SECTION) { in read_retpoline_hints()
1903 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_retpoline_hints()
1928 struct reloc *reloc; in read_instr_hints() local
1934 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1935 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1940 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1953 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1954 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1959 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1975 struct reloc *reloc; in read_intra_function_calls() local
1981 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_intra_function_calls()
1984 if (reloc->sym->type != STT_SECTION) { in read_intra_function_calls()
1990 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_intra_function_calls()