Lines Matching refs:reloc

461 	struct reloc *rel;  in add_pv_ops()
549 struct reloc *reloc; in add_dead_ends() local
559 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
560 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
564 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
567 else if (reloc->addend == reloc->sym->sec->sh.sh_size) { in add_dead_ends()
568 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
571 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
576 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
594 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
595 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
599 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
602 else if (reloc->addend == reloc->sym->sec->sh.sh_size) { in add_dead_ends()
603 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
606 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
611 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
904 struct reloc *reloc; in add_ignores() local
910 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignores()
911 switch (reloc->sym->type) { in add_ignores()
913 func = reloc->sym; in add_ignores()
917 func = find_func_by_offset(reloc->sym->sec, reloc->addend); in add_ignores()
923 WARN("unexpected relocation symbol type in %s: %d", sec->name, reloc->sym->type); in add_ignores()
1128 struct reloc *reloc; in add_ignore_alternatives() local
1135 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignore_alternatives()
1136 if (reloc->sym->type != STT_SECTION) { in add_ignore_alternatives()
1141 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_ignore_alternatives()
1165 static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn) in insn_reloc()
1167 if (insn->reloc == NEGATIVE_RELOC) in insn_reloc()
1170 if (!insn->reloc) { in insn_reloc()
1174 insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec, in insn_reloc()
1176 if (!insn->reloc) { in insn_reloc()
1177 insn->reloc = NEGATIVE_RELOC; in insn_reloc()
1182 return insn->reloc; in insn_reloc()
1198 struct reloc *reloc = insn_reloc(file, insn); in annotate_call_site() local
1202 sym = reloc->sym; in annotate_call_site()
1229 if (reloc) { in annotate_call_site()
1230 reloc->type = R_NONE; in annotate_call_site()
1231 elf_write_reloc(file->elf, reloc); in annotate_call_site()
1258 if (reloc) { in annotate_call_site()
1259 reloc->type = R_NONE; in annotate_call_site()
1260 elf_write_reloc(file->elf, reloc); in annotate_call_site()
1370 struct reloc *reloc; in add_jump_destinations() local
1385 reloc = insn_reloc(file, insn); in add_jump_destinations()
1386 if (!reloc) { in add_jump_destinations()
1389 } else if (reloc->sym->type == STT_SECTION) { in add_jump_destinations()
1390 dest_sec = reloc->sym->sec; in add_jump_destinations()
1391 dest_off = arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
1392 } else if (reloc->sym->retpoline_thunk) { in add_jump_destinations()
1395 } else if (reloc->sym->return_thunk) { in add_jump_destinations()
1403 add_call_dest(file, insn, reloc->sym, true); in add_jump_destinations()
1405 } else if (reloc->sym->sec->idx) { in add_jump_destinations()
1406 dest_sec = reloc->sym->sec; in add_jump_destinations()
1407 dest_off = reloc->sym->sym.st_value + in add_jump_destinations()
1408 arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
1499 struct reloc *reloc; in add_call_destinations() local
1505 reloc = insn_reloc(file, insn); in add_call_destinations()
1506 if (!reloc) { in add_call_destinations()
1526 } else if (reloc->sym->type == STT_SECTION) { in add_call_destinations()
1527 dest_off = arch_dest_reloc_offset(reloc->addend); in add_call_destinations()
1528 dest = find_call_destination(reloc->sym->sec, dest_off); in add_call_destinations()
1532 reloc->sym->sec->name, in add_call_destinations()
1539 } else if (reloc->sym->retpoline_thunk) { in add_call_destinations()
1543 add_call_dest(file, insn, reloc->sym, false); in add_call_destinations()
1628 struct reloc *alt_reloc; in handle_group_alt()
1708 struct reloc *reloc = insn_reloc(file, orig_insn); in handle_jump_alt() local
1710 if (reloc) { in handle_jump_alt()
1711 reloc->type = R_NONE; in handle_jump_alt()
1712 elf_write_reloc(file->elf, reloc); in handle_jump_alt()
1825 struct reloc *table) in add_jump_table()
1827 struct reloc *reloc = table; in add_jump_table() local
1837 list_for_each_entry_from(reloc, &table->sec->reloc_list, list) { in add_jump_table()
1840 if (reloc != table && reloc->jump_table_start) in add_jump_table()
1844 if (prev_offset && reloc->offset != prev_offset + 8) in add_jump_table()
1848 if (reloc->sym->sec == pfunc->sec && in add_jump_table()
1849 reloc->addend == pfunc->offset) in add_jump_table()
1852 dest_insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_jump_table()
1868 prev_offset = reloc->offset; in add_jump_table()
1884 static struct reloc *find_jump_table(struct objtool_file *file, in find_jump_table()
1888 struct reloc *table_reloc; in find_jump_table()
1931 struct reloc *reloc; in mark_func_jump_tables() local
1954 reloc = find_jump_table(file, func, insn); in mark_func_jump_tables()
1955 if (reloc) { in mark_func_jump_tables()
1956 reloc->jump_table_start = true; in mark_func_jump_tables()
1957 insn->jump_table = reloc; in mark_func_jump_tables()
2023 struct reloc *reloc; in read_unwind_hints() local
2030 relocsec = sec->reloc; in read_unwind_hints()
2046 reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint)); in read_unwind_hints()
2047 if (!reloc) { in read_unwind_hints()
2052 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_unwind_hints()
2117 struct reloc *reloc; in read_noendbr_hints() local
2123 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_noendbr_hints()
2124 insn = find_insn(file, reloc->sym->sec, reloc->sym->offset + reloc->addend); in read_noendbr_hints()
2140 struct reloc *reloc; in read_retpoline_hints() local
2146 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_retpoline_hints()
2147 if (reloc->sym->type != STT_SECTION) { in read_retpoline_hints()
2152 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_retpoline_hints()
2177 struct reloc *reloc; in read_instr_hints() local
2183 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
2184 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
2189 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
2202 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
2203 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
2208 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
2224 struct reloc *reloc; in read_intra_function_calls() local
2230 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_intra_function_calls()
2233 if (reloc->sym->type != STT_SECTION) { in read_intra_function_calls()
2239 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_intra_function_calls()
3147 struct reloc *rel; in call_dest_name()
3166 struct reloc *rel; in pv_call_dest()
3990 struct reloc *reloc; in validate_ibt_insn() local
4012 for (reloc = insn_reloc(file, insn); in validate_ibt_insn()
4013 reloc; in validate_ibt_insn()
4014 reloc = find_reloc_by_dest_range(file->elf, insn->sec, in validate_ibt_insn()
4015 reloc->offset + 1, in validate_ibt_insn()
4016 (insn->offset + insn->len) - (reloc->offset + 1))) { in validate_ibt_insn()
4022 if (reloc->sym->static_call_tramp) in validate_ibt_insn()
4025 off = reloc->sym->offset; in validate_ibt_insn()
4026 if (reloc->type == R_X86_64_PC32 || reloc->type == R_X86_64_PLT32) in validate_ibt_insn()
4027 off += arch_dest_reloc_offset(reloc->addend); in validate_ibt_insn()
4029 off += reloc->addend; in validate_ibt_insn()
4031 dest = find_insn(file, reloc->sym->sec, off); in validate_ibt_insn()
4073 struct reloc *reloc) in validate_ibt_data_reloc() argument
4077 dest = find_insn(file, reloc->sym->sec, in validate_ibt_data_reloc()
4078 reloc->sym->offset + reloc->addend); in validate_ibt_data_reloc()
4091 reloc->sec->base, reloc->offset, in validate_ibt_data_reloc()
4105 struct reloc *reloc; in validate_ibt() local
4118 if (!sec->reloc) in validate_ibt()
4145 list_for_each_entry(reloc, &sec->reloc->reloc_list, list) in validate_ibt()
4146 warnings += validate_ibt_data_reloc(file, reloc); in validate_ibt()