Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'objtool_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fix from Borislav Petkov:

- Handle symbol relocations properly due to changes in the toolchains
which remove section symbols now

* tag 'objtool_urgent_for_v5.15_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Teach get_alt_entry() about more relocation types

+25 -7
+25 -7
tools/objtool/special.c
··· 58 58 { 59 59 } 60 60 61 + static bool reloc2sec_off(struct reloc *reloc, struct section **sec, unsigned long *off) 62 + { 63 + switch (reloc->sym->type) { 64 + case STT_FUNC: 65 + *sec = reloc->sym->sec; 66 + *off = reloc->sym->offset + reloc->addend; 67 + return true; 68 + 69 + case STT_SECTION: 70 + *sec = reloc->sym->sec; 71 + *off = reloc->addend; 72 + return true; 73 + 74 + default: 75 + return false; 76 + } 77 + } 78 + 61 79 static int get_alt_entry(struct elf *elf, struct special_entry *entry, 62 80 struct section *sec, int idx, 63 81 struct special_alt *alt) ··· 109 91 WARN_FUNC("can't find orig reloc", sec, offset + entry->orig); 110 92 return -1; 111 93 } 112 - if (orig_reloc->sym->type != STT_SECTION) { 113 - WARN_FUNC("don't know how to handle non-section reloc symbol %s", 94 + if (!reloc2sec_off(orig_reloc, &alt->orig_sec, &alt->orig_off)) { 95 + WARN_FUNC("don't know how to handle reloc symbol type: %s", 114 96 sec, offset + entry->orig, orig_reloc->sym->name); 115 97 return -1; 116 98 } 117 - 118 - alt->orig_sec = orig_reloc->sym->sec; 119 - alt->orig_off = orig_reloc->addend; 120 99 121 100 if (!entry->group || alt->new_len) { 122 101 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); ··· 131 116 if (arch_is_retpoline(new_reloc->sym)) 132 117 return 1; 133 118 134 - alt->new_sec = new_reloc->sym->sec; 135 - alt->new_off = (unsigned int)new_reloc->addend; 119 + if (!reloc2sec_off(new_reloc, &alt->new_sec, &alt->new_off)) { 120 + WARN_FUNC("don't know how to handle reloc symbol type: %s", 121 + sec, offset + entry->new, new_reloc->sym->name); 122 + return -1; 123 + } 136 124 137 125 /* _ASM_EXTABLE_EX hack */ 138 126 if (alt->new_off >= 0x7ffffff0)