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-2020-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fix from Thomas Gleixner:
"A single fix for objtool to prevent an infinite loop in the
jump table search which can be triggered when building the
kernel with '-ffunction-sections'"

* tag 'objtool-urgent-2020-05-10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Fix infinite loop in find_jump_table()

+13 -2
+13 -2
tools/objtool/check.c
··· 72 72 return find_insn(file, func->cfunc->sec, func->cfunc->offset); 73 73 } 74 74 75 + static struct instruction *prev_insn_same_sym(struct objtool_file *file, 76 + struct instruction *insn) 77 + { 78 + struct instruction *prev = list_prev_entry(insn, list); 79 + 80 + if (&prev->list != &file->insn_list && prev->func == insn->func) 81 + return prev; 82 + 83 + return NULL; 84 + } 85 + 75 86 #define func_for_each_insn(file, func, insn) \ 76 87 for (insn = find_insn(file, func->sec, func->offset); \ 77 88 insn; \ ··· 1061 1050 * it. 1062 1051 */ 1063 1052 for (; 1064 - &insn->list != &file->insn_list && insn->func && insn->func->pfunc == func; 1065 - insn = insn->first_jump_src ?: list_prev_entry(insn, list)) { 1053 + insn && insn->func && insn->func->pfunc == func; 1054 + insn = insn->first_jump_src ?: prev_insn_same_sym(file, insn)) { 1066 1055 1067 1056 if (insn != orig_insn && insn->type == INSN_JUMP_DYNAMIC) 1068 1057 break;