projects/linux·commit cf4d5be8

Merge tag 'core-urgent-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

cf4d5be8 · Linus Torvalds <[email protected]> · 2023-01-12 14:41:32 -06:00

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
Commit
cf4d5be89c0ad339108e672a2f973bf276bd5d2c
Parents
f129b616 · cad90e53

Merge commit. Changes below are compared with the first parent: f129b616.

Changes

1 files changed · +9 −0

FileStatusAddDelContent
tools/objtool/check.cmodified+9−0View file

tools/objtool/check.c

View file
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4350be7..4b7c8b3 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -427,6 +427,15 @@ static int decode_instructions(struct objtool_file *file)
if (func->type != STT_NOTYPE && func->type != STT_FUNC)
continue;
+ if (func->offset == sec->sh.sh_size) {
+ /* Heuristic: likely an "end" symbol */
+ if (func->type == STT_NOTYPE)
+ continue;
+ WARN("%s(): STT_FUNC at end of section",
+ func->name);
+ return -1;
+ }
+
if (func->return_thunk || func->alias != func)
continue;