Lines Matching refs:reloc

366 	struct reloc *reloc;  in add_dead_ends()  local
384 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
385 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
389 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
392 else if (reloc->addend == reloc->sym->sec->sh.sh_size) { in add_dead_ends()
393 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
396 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
401 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
419 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
420 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
424 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
427 else if (reloc->addend == reloc->sym->sec->sh.sh_size) { in add_dead_ends()
428 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
431 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
436 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
585 struct reloc *reloc; in add_ignores() local
591 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignores()
592 switch (reloc->sym->type) { in add_ignores()
594 func = reloc->sym; in add_ignores()
598 func = find_func_by_offset(reloc->sym->sec, reloc->addend); in add_ignores()
604 WARN("unexpected relocation symbol type in %s: %d", sec->name, reloc->sym->type); in add_ignores()
782 struct reloc *reloc; in add_ignore_alternatives() local
789 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignore_alternatives()
790 if (reloc->sym->type != STT_SECTION) { in add_ignore_alternatives()
795 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_ignore_alternatives()
814 static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) in insn_reloc()
816 if (insn->reloc == NEGATIVE_RELOC) in insn_reloc()
819 if (!insn->reloc) { in insn_reloc()
820 insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec, in insn_reloc()
822 if (!insn->reloc) { in insn_reloc()
823 insn->reloc = NEGATIVE_RELOC; in insn_reloc()
828 return insn->reloc; in insn_reloc()
837 struct reloc *reloc; in add_jump_destinations() local
845 reloc = insn_reloc(file, insn); in add_jump_destinations()
846 if (!reloc) { in add_jump_destinations()
849 } else if (reloc->sym->type == STT_SECTION) { in add_jump_destinations()
850 dest_sec = reloc->sym->sec; in add_jump_destinations()
851 dest_off = arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
852 } else if (arch_is_retpoline(reloc->sym)) { in add_jump_destinations()
869 insn->call_dest = reloc->sym; in add_jump_destinations()
875 } else if (reloc->sym->sec->idx) { in add_jump_destinations()
876 dest_sec = reloc->sym->sec; in add_jump_destinations()
877 dest_off = reloc->sym->sym.st_value + in add_jump_destinations()
878 arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
971 struct reloc *reloc; in add_call_destinations() local
977 reloc = insn_reloc(file, insn); in add_call_destinations()
978 if (!reloc) { in add_call_destinations()
996 } else if (reloc->sym->type == STT_SECTION) { in add_call_destinations()
997 dest_off = arch_dest_reloc_offset(reloc->addend); in add_call_destinations()
998 insn->call_dest = find_call_destination(reloc->sym->sec, in add_call_destinations()
1003 reloc->sym->sec->name, in add_call_destinations()
1008 } else if (arch_is_retpoline(reloc->sym)) { in add_call_destinations()
1023 insn->call_dest = reloc->sym; in add_call_destinations()
1037 if (reloc) { in add_call_destinations()
1038 reloc->type = R_NONE; in add_call_destinations()
1039 elf_write_reloc(file->elf, reloc); in add_call_destinations()
1049 if (reloc) { in add_call_destinations()
1050 reloc->type = R_NONE; in add_call_destinations()
1051 elf_write_reloc(file->elf, reloc); in add_call_destinations()
1157 struct reloc *alt_reloc; in handle_group_alt()
1237 struct reloc *reloc = insn_reloc(file, orig_insn); in handle_jump_alt() local
1239 if (reloc) { in handle_jump_alt()
1240 reloc->type = R_NONE; in handle_jump_alt()
1241 elf_write_reloc(file->elf, reloc); in handle_jump_alt()
1354 struct reloc *table) in add_jump_table()
1356 struct reloc *reloc = table; in add_jump_table() local
1366 list_for_each_entry_from(reloc, &table->sec->reloc_list, list) { in add_jump_table()
1369 if (reloc != table && reloc->jump_table_start) in add_jump_table()
1373 if (prev_offset && reloc->offset != prev_offset + 8) in add_jump_table()
1377 if (reloc->sym->sec == pfunc->sec && in add_jump_table()
1378 reloc->addend == pfunc->offset) in add_jump_table()
1381 dest_insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_jump_table()
1397 prev_offset = reloc->offset; in add_jump_table()
1413 static struct reloc *find_jump_table(struct objtool_file *file, in find_jump_table()
1417 struct reloc *table_reloc; in find_jump_table()
1460 struct reloc *reloc; in mark_func_jump_tables() local
1483 reloc = find_jump_table(file, func, insn); in mark_func_jump_tables()
1484 if (reloc) { in mark_func_jump_tables()
1485 reloc->jump_table_start = true; in mark_func_jump_tables()
1486 insn->jump_table = reloc; in mark_func_jump_tables()
1549 struct reloc *reloc; in read_unwind_hints() local
1558 relocsec = sec->reloc; in read_unwind_hints()
1574 reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint)); in read_unwind_hints()
1575 if (!reloc) { in read_unwind_hints()
1580 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_unwind_hints()
1611 struct reloc *reloc; in read_retpoline_hints() local
1617 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_retpoline_hints()
1618 if (reloc->sym->type != STT_SECTION) { in read_retpoline_hints()
1623 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_retpoline_hints()
1646 struct reloc *reloc; in read_instr_hints() local
1652 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1653 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1658 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1671 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1672 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1677 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1693 struct reloc *reloc; in read_intra_function_calls() local
1699 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_intra_function_calls()
1702 if (reloc->sym->type != STT_SECTION) { in read_intra_function_calls()
1708 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_intra_function_calls()