Skip to content

Commit 08feafe

Browse files
jpoimboePeter Zijlstra
authored andcommitted
objtool: Fix function fallthrough detection for vmlinux
Objtool's function fallthrough detection only works on C objects. The distinction between C and assembly objects no longer makes sense with objtool running on vmlinux.o. Now that copy_user_64.S has been fixed up, and an objtool sibling call detection bug has been fixed, the asm code is in "compliance" and this hack is no longer needed. Remove it. Fixes: ed53a0d ("x86/alternative: Use .ibt_endbr_seal to seal indirect calls") Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/b434cff98eca3a60dcc64c620d7d5d405a0f441c.1649718562.git.jpoimboe@redhat.com
1 parent 34c861e commit 08feafe

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

tools/objtool/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3310,7 +3310,7 @@ static int validate_branch(struct objtool_file *file, struct symbol *func,
33103310
while (1) {
33113311
next_insn = next_insn_to_validate(file, insn);
33123312

3313-
if (file->c_file && func && insn->func && func != insn->func->pfunc) {
3313+
if (func && insn->func && func != insn->func->pfunc) {
33143314
WARN("%s() falls through to next function %s()",
33153315
func->name, insn->func->name);
33163316
return 1;

tools/objtool/include/objtool/objtool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct objtool_file {
2727
struct list_head static_call_list;
2828
struct list_head mcount_loc_list;
2929
struct list_head endbr_list;
30-
bool ignore_unreachables, c_file, hints, rodata;
30+
bool ignore_unreachables, hints, rodata;
3131

3232
unsigned int nr_endbr;
3333
unsigned int nr_endbr_int;

tools/objtool/objtool.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ struct objtool_file *objtool_open_read(const char *_objname)
129129
INIT_LIST_HEAD(&file.static_call_list);
130130
INIT_LIST_HEAD(&file.mcount_loc_list);
131131
INIT_LIST_HEAD(&file.endbr_list);
132-
file.c_file = !vmlinux && find_section_by_name(file.elf, ".comment");
133132
file.ignore_unreachables = no_unreachable;
134133
file.hints = false;
135134

0 commit comments

Comments
 (0)