Lines Matching refs:reloc

349 	struct reloc *reloc;  in add_dead_ends()  local
367 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
368 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
372 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
375 else if (reloc->addend == reloc->sym->sec->len) { in add_dead_ends()
376 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
379 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
384 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
402 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_dead_ends()
403 if (reloc->sym->type != STT_SECTION) { in add_dead_ends()
407 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_dead_ends()
410 else if (reloc->addend == reloc->sym->sec->len) { in add_dead_ends()
411 insn = find_last_insn(file, reloc->sym->sec); in add_dead_ends()
414 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
419 reloc->sym->sec->name, reloc->addend); in add_dead_ends()
432 struct reloc *reloc; in create_static_call_sections() local
469 reloc = malloc(sizeof(*reloc)); in create_static_call_sections()
470 if (!reloc) { in create_static_call_sections()
474 memset(reloc, 0, sizeof(*reloc)); in create_static_call_sections()
475 reloc->sym = insn->sec->sym; in create_static_call_sections()
476 reloc->addend = insn->offset; in create_static_call_sections()
477 reloc->type = R_X86_64_PC32; in create_static_call_sections()
478 reloc->offset = idx * sizeof(struct static_call_site); in create_static_call_sections()
479 reloc->sec = reloc_sec; in create_static_call_sections()
480 elf_add_reloc(file->elf, reloc); in create_static_call_sections()
504 reloc = malloc(sizeof(*reloc)); in create_static_call_sections()
505 if (!reloc) { in create_static_call_sections()
509 memset(reloc, 0, sizeof(*reloc)); in create_static_call_sections()
510 reloc->sym = key_sym; in create_static_call_sections()
511 reloc->addend = is_sibling_call(insn) ? STATIC_CALL_SITE_TAIL : 0; in create_static_call_sections()
512 reloc->type = R_X86_64_PC32; in create_static_call_sections()
513 reloc->offset = idx * sizeof(struct static_call_site) + 4; in create_static_call_sections()
514 reloc->sec = reloc_sec; in create_static_call_sections()
515 elf_add_reloc(file->elf, reloc); in create_static_call_sections()
534 struct reloc *reloc; in add_ignores() local
540 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignores()
541 switch (reloc->sym->type) { in add_ignores()
543 func = reloc->sym; in add_ignores()
547 func = find_func_by_offset(reloc->sym->sec, reloc->addend); in add_ignores()
553 WARN("unexpected relocation symbol type in %s: %d", sec->name, reloc->sym->type); in add_ignores()
731 struct reloc *reloc; in add_ignore_alternatives() local
738 list_for_each_entry(reloc, &sec->reloc_list, list) { in add_ignore_alternatives()
739 if (reloc->sym->type != STT_SECTION) { in add_ignore_alternatives()
744 insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_ignore_alternatives()
762 struct reloc *reloc; in add_jump_destinations() local
773 reloc = find_reloc_by_dest_range(file->elf, insn->sec, in add_jump_destinations()
775 if (!reloc) { in add_jump_destinations()
778 } else if (reloc->sym->type == STT_SECTION) { in add_jump_destinations()
779 dest_sec = reloc->sym->sec; in add_jump_destinations()
780 dest_off = arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
781 } else if (reloc->sym->sec->idx) { in add_jump_destinations()
782 dest_sec = reloc->sym->sec; in add_jump_destinations()
783 dest_off = reloc->sym->sym.st_value + in add_jump_destinations()
784 arch_dest_reloc_offset(reloc->addend); in add_jump_destinations()
785 } else if (strstr(reloc->sym->name, "_indirect_thunk_")) { in add_jump_destinations()
799 insn->call_dest = reloc->sym; in add_jump_destinations()
894 struct reloc *reloc; in add_call_destinations() local
900 reloc = find_reloc_by_dest_range(file->elf, insn->sec, in add_call_destinations()
902 if (!reloc) { in add_call_destinations()
920 } else if (reloc->sym->type == STT_SECTION) { in add_call_destinations()
921 dest_off = arch_dest_reloc_offset(reloc->addend); in add_call_destinations()
922 insn->call_dest = find_call_destination(reloc->sym->sec, in add_call_destinations()
927 reloc->sym->sec->name, in add_call_destinations()
932 insn->call_dest = reloc->sym; in add_call_destinations()
941 if (reloc) { in add_call_destinations()
942 reloc->type = R_NONE; in add_call_destinations()
943 elf_write_reloc(file->elf, reloc); in add_call_destinations()
1035 struct reloc *alt_reloc; in handle_group_alt()
1203 struct reloc *table) in add_jump_table()
1205 struct reloc *reloc = table; in add_jump_table() local
1215 list_for_each_entry_from(reloc, &table->sec->reloc_list, list) { in add_jump_table()
1218 if (reloc != table && reloc->jump_table_start) in add_jump_table()
1222 if (prev_offset && reloc->offset != prev_offset + 8) in add_jump_table()
1226 if (reloc->sym->sec == pfunc->sec && in add_jump_table()
1227 reloc->addend == pfunc->offset) in add_jump_table()
1230 dest_insn = find_insn(file, reloc->sym->sec, reloc->addend); in add_jump_table()
1246 prev_offset = reloc->offset; in add_jump_table()
1262 static struct reloc *find_jump_table(struct objtool_file *file, in find_jump_table()
1266 struct reloc *table_reloc; in find_jump_table()
1309 struct reloc *reloc; in mark_func_jump_tables() local
1332 reloc = find_jump_table(file, func, insn); in mark_func_jump_tables()
1333 if (reloc) { in mark_func_jump_tables()
1334 reloc->jump_table_start = true; in mark_func_jump_tables()
1335 insn->jump_table = reloc; in mark_func_jump_tables()
1390 struct reloc *reloc; in read_unwind_hints() local
1400 relocsec = sec->reloc; in read_unwind_hints()
1416 reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint)); in read_unwind_hints()
1417 if (!reloc) { in read_unwind_hints()
1422 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_unwind_hints()
1455 struct reloc *reloc; in read_retpoline_hints() local
1461 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_retpoline_hints()
1462 if (reloc->sym->type != STT_SECTION) { in read_retpoline_hints()
1467 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_retpoline_hints()
1490 struct reloc *reloc; in read_instr_hints() local
1496 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1497 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1502 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1515 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_instr_hints()
1516 if (reloc->sym->type != STT_SECTION) { in read_instr_hints()
1521 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_instr_hints()
1537 struct reloc *reloc; in read_intra_function_calls() local
1543 list_for_each_entry(reloc, &sec->reloc_list, list) { in read_intra_function_calls()
1546 if (reloc->sym->type != STT_SECTION) { in read_intra_function_calls()
1552 insn = find_insn(file, reloc->sym->sec, reloc->addend); in read_intra_function_calls()