Lines Matching defs:reloc
445 struct reloc *reloc;
463 list_for_each_entry(reloc, &sec->reloc_list, list) {
464 if (reloc->sym->type != STT_SECTION) {
468 insn = find_insn(file, reloc->sym->sec, reloc->addend);
471 else if (reloc->addend == reloc->sym->sec->len) {
472 insn = find_last_insn(file, reloc->sym->sec);
475 reloc->sym->sec->name, reloc->addend);
480 reloc->sym->sec->name, reloc->addend);
498 list_for_each_entry(reloc, &sec->reloc_list, list) {
499 if (reloc->sym->type != STT_SECTION) {
503 insn = find_insn(file, reloc->sym->sec, reloc->addend);
506 else if (reloc->addend == reloc->sym->sec->len) {
507 insn = find_last_insn(file, reloc->sym->sec);
510 reloc->sym->sec->name, reloc->addend);
515 reloc->sym->sec->name, reloc->addend);
559 /* populate reloc for 'addr' */
602 /* populate reloc for 'key' */
715 struct reloc *reloc;
721 list_for_each_entry(reloc, &sec->reloc_list, list) {
722 switch (reloc->sym->type) {
724 func = reloc->sym;
728 func = find_func_by_offset(reloc->sym->sec, reloc->addend);
734 WARN("unexpected relocation symbol type in %s: %d", sec->name, reloc->sym->type);
924 struct reloc *reloc;
931 list_for_each_entry(reloc, &sec->reloc_list, list) {
932 if (reloc->sym->type != STT_SECTION) {
937 insn = find_insn(file, reloc->sym->sec, reloc->addend);
978 static struct reloc *insn_reloc(struct objtool_file *file, struct instruction *insn)
980 if (insn->reloc == NEGATIVE_RELOC)
983 if (!insn->reloc) {
984 insn->reloc = find_reloc_by_dest_range(file->elf, insn->sec,
986 if (!insn->reloc) {
987 insn->reloc = NEGATIVE_RELOC;
992 return insn->reloc;
1008 struct reloc *reloc = insn_reloc(file, insn);
1012 sym = reloc->sym;
1039 if (reloc) {
1040 reloc->type = R_NONE;
1041 elf_write_reloc(file->elf, reloc);
1138 struct reloc *reloc;
1146 reloc = insn_reloc(file, insn);
1147 if (!reloc) {
1150 } else if (reloc->sym->type == STT_SECTION) {
1151 dest_sec = reloc->sym->sec;
1152 dest_off = arch_dest_reloc_offset(reloc->addend);
1153 } else if (reloc->sym->retpoline_thunk) {
1156 } else if (reloc->sym->return_thunk) {
1160 /* internal or external sibling call (with reloc) */
1161 add_call_dest(file, insn, reloc->sym, true);
1163 } else if (reloc->sym->sec->idx) {
1164 dest_sec = reloc->sym->sec;
1165 dest_off = reloc->sym->sym.st_value +
1166 arch_dest_reloc_offset(reloc->addend);
1231 /* internal sibling call (without reloc) */
1259 struct reloc *reloc;
1265 reloc = insn_reloc(file, insn);
1266 if (!reloc) {
1286 } else if (reloc->sym->type == STT_SECTION) {
1287 dest_off = arch_dest_reloc_offset(reloc->addend);
1288 dest = find_call_destination(reloc->sym->sec, dest_off);
1292 reloc->sym->sec->name,
1299 } else if (reloc->sym->retpoline_thunk) {
1303 add_call_dest(file, insn, reloc->sym, false);
1388 struct reloc *alt_reloc;
1553 struct reloc *table)
1555 struct reloc *reloc = table;
1562 * Each @reloc is a switch table relocation which points to the target
1565 list_for_each_entry_from(reloc, &table->sec->reloc_list, list) {
1568 if (reloc != table && reloc->jump_table_start)
1572 if (prev_offset && reloc->offset != prev_offset + 8)
1576 if (reloc->sym->sec == pfunc->sec &&
1577 reloc->addend == pfunc->offset)
1580 dest_insn = find_insn(file, reloc->sym->sec, reloc->addend);
1596 prev_offset = reloc->offset;
1612 static struct reloc *find_jump_table(struct objtool_file *file,
1616 struct reloc *table_reloc;
1659 struct reloc *reloc;
1682 reloc = find_jump_table(file, func, insn);
1683 if (reloc) {
1684 reloc->jump_table_start = true;
1685 insn->jump_table = reloc;
1751 struct reloc *reloc;
1758 relocsec = sec->reloc;
1774 reloc = find_reloc_by_dest(file->elf, sec, i * sizeof(*hint));
1775 if (!reloc) {
1776 WARN("can't find reloc for unwind_hints[%d]", i);
1780 insn = find_insn(file, reloc->sym->sec, reloc->addend);
1840 struct reloc *reloc;
1846 list_for_each_entry(reloc, &sec->reloc_list, list) {
1847 if (reloc->sym->type != STT_SECTION) {
1852 insn = find_insn(file, reloc->sym->sec, reloc->addend);
1877 struct reloc *reloc;
1883 list_for_each_entry(reloc, &sec->reloc_list, list) {
1884 if (reloc->sym->type != STT_SECTION) {
1889 insn = find_insn(file, reloc->sym->sec, reloc->addend);
1902 list_for_each_entry(reloc, &sec->reloc_list, list) {
1903 if (reloc->sym->type != STT_SECTION) {
1908 insn = find_insn(file, reloc->sym->sec, reloc->addend);
1924 struct reloc *reloc;
1930 list_for_each_entry(reloc, &sec->reloc_list, list) {
1933 if (reloc->sym->type != STT_SECTION) {
1939 insn = find_insn(file, reloc->sym->sec, reloc->addend);