Skip to content

Commit cf4d5be

Browse files
committed
Merge tag 'core-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fix from Ingo Molnar: - Fix objtool to be more permissive with hand-written assembly that uses non-function symbols in executable sections. * tag 'core-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Tolerate STT_NOTYPE symbols at end of section
2 parents f129b61 + cad90e5 commit cf4d5be

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tools/objtool/check.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,15 @@ static int decode_instructions(struct objtool_file *file)
427427
if (func->type != STT_NOTYPE && func->type != STT_FUNC)
428428
continue;
429429

430+
if (func->offset == sec->sh.sh_size) {
431+
/* Heuristic: likely an "end" symbol */
432+
if (func->type == STT_NOTYPE)
433+
continue;
434+
WARN("%s(): STT_FUNC at end of section",
435+
func->name);
436+
return -1;
437+
}
438+
430439
if (func->return_thunk || func->alias != func)
431440
continue;
432441

0 commit comments

Comments
 (0)