Lines Matching refs:reloc

430 	struct reloc *rel;  in add_pv_ops()
518 struct reloc *reloc; in add_dead_ends() local
536 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
537 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
541 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
544 else if (reloc->addend == reloc->sym->sec->sh.sh_size) { in add_dead_ends()
545 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
548 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
553 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
571 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
572 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
576 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
579 else if (reloc->addend == reloc->sym->sec->sh.sh_size) { in add_dead_ends()
580 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
583 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
588 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
783 struct reloc *reloc; in add_ignores() local
789 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignores()
790 switch (reloc->sym->type) { in add_ignores()
792 func = reloc->sym; in add_ignores()
796 func = find_func_by_offset(reloc->sym->sec, reloc->addend); in add_ignores()
802 WARN("unexpected relocation symbol type in %s: %d", sec->name, reloc->sym->type); in add_ignores()
980 struct reloc *reloc; in add_ignore_alternatives() local
987 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignore_alternatives()
988 if (reloc->sym->type != STT_SECTION) { in add_ignore_alternatives()
993 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_ignore_alternatives()
1012 static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) in insn_reloc()
1014 if (insn->reloc == NEGATIVE_RELOC) in insn_reloc()
1017 if (!insn->reloc) { in insn_reloc()
1021 insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec, in insn_reloc()
1023 if (!insn->reloc) { in insn_reloc()
1024 insn->reloc = NEGATIVE_RELOC; in insn_reloc()
1029 return insn->reloc; in insn_reloc()
1045 struct reloc *reloc = insn_reloc(file, insn); in annotate_call_site() local
1049 sym = reloc->sym; in annotate_call_site()
1076 if (reloc) { in annotate_call_site()
1077 reloc->type = R_NONE; in annotate_call_site()
1078 elf_write_reloc(file->elf, reloc); in annotate_call_site()
1094 if (reloc) { in annotate_call_site()
1095 reloc->type = R_NONE; in annotate_call_site()
1096 elf_write_reloc(file->elf, reloc); in annotate_call_site()
1168 struct reloc *reloc; in add_jump_destinations() local
1176 reloc = insn_reloc(file, insn); in add_jump_destinations()
1177 if (!reloc) { in add_jump_destinations()
1180 } else if (reloc->sym->type == STT_SECTION) { in add_jump_destinations()
1181 dest_sec = reloc->sym->sec; in add_jump_destinations()
1182 dest_off = arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
1183 } else if (reloc->sym->retpoline_thunk) { in add_jump_destinations()
1188 add_call_dest(file, insn, reloc->sym, true); in add_jump_destinations()
1190 } else if (reloc->sym->sec->idx) { in add_jump_destinations()
1191 dest_sec = reloc->sym->sec; in add_jump_destinations()
1192 dest_off = reloc->sym->sym.st_value + in add_jump_destinations()
1193 arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
1272 struct reloc *reloc; in add_call_destinations() local
1278 reloc = insn_reloc(file, insn); in add_call_destinations()
1279 if (!reloc) { in add_call_destinations()
1299 } else if (reloc->sym->type == STT_SECTION) { in add_call_destinations()
1300 dest_off = arch_dest_reloc_offset(reloc->addend); in add_call_destinations()
1301 dest = find_call_destination(reloc->sym->sec, dest_off); in add_call_destinations()
1305 reloc->sym->sec->name, in add_call_destinations()
1312 } else if (reloc->sym->retpoline_thunk) { in add_call_destinations()
1316 add_call_dest(file, insn, reloc->sym, false); in add_call_destinations()
1401 struct reloc *alt_reloc; in handle_group_alt()
1481 struct reloc *reloc = insn_reloc(file, orig_insn); in handle_jump_alt() local
1483 if (reloc) { in handle_jump_alt()
1484 reloc->type = R_NONE; in handle_jump_alt()
1485 elf_write_reloc(file->elf, reloc); in handle_jump_alt()
1598 struct reloc *table) in add_jump_table()
1600 struct reloc *reloc = table; in add_jump_table() local
1610 list_for_each_entry_from(reloc, &table->sec->reloc_list, list) { in add_jump_table()
1613 if (reloc != table && reloc->jump_table_start) in add_jump_table()
1617 if (prev_offset && reloc->offset != prev_offset + 8) in add_jump_table()
1621 if (reloc->sym->sec == pfunc->sec && in add_jump_table()
1622 reloc->addend == pfunc->offset) in add_jump_table()
1625 dest_insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_jump_table()
1641 prev_offset = reloc->offset; in add_jump_table()
1657 static struct reloc *find_jump_table(struct objtool_file *file, in find_jump_table()
1661 struct reloc *table_reloc; in find_jump_table()
1704 struct reloc *reloc; in mark_func_jump_tables() local
1727 reloc = find_jump_table(file, func, insn); in mark_func_jump_tables()
1728 if (reloc) { in mark_func_jump_tables()
1729 reloc->jump_table_start = true; in mark_func_jump_tables()
1730 insn->jump_table = reloc; in mark_func_jump_tables()
1796 struct reloc *reloc; in read_unwind_hints() local
1803 relocsec = sec->reloc; in read_unwind_hints()
1819 reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint)); in read_unwind_hints()
1820 if (!reloc) { in read_unwind_hints()
1825 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_unwind_hints()
1861 struct reloc *reloc; in read_retpoline_hints() local
1867 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_retpoline_hints()
1868 if (reloc->sym->type != STT_SECTION) { in read_retpoline_hints()
1873 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_retpoline_hints()
1896 struct reloc *reloc; in read_instr_hints() local
1902 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1903 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1908 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1921 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1922 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1927 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1943 struct reloc *reloc; in read_intra_function_calls() local
1949 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_intra_function_calls()
1952 if (reloc->sym->type != STT_SECTION) { in read_intra_function_calls()
1958 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_intra_function_calls()
2827 struct reloc *rel; in call_dest_name()
2846 struct reloc *rel; in pv_call_dest()