summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-01-12 21:41:32 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2023-01-12 21:41:32 +0100
commitcf4d5be89c0ad339108e672a2f973bf276bd5d2c (patch)
treed50ccc4fe07f2e16578d390f7f5418a010a23106 /tools
parentMerge tag 'urgent-nolibc.2023.01.09a' of git://git.kernel.org/pub/scm/linux/k... (diff)
parentobjtool: Tolerate STT_NOTYPE symbols at end of section (diff)
downloadlinux-cf4d5be89c0ad339108e672a2f973bf276bd5d2c.tar.xz
linux-cf4d5be89c0ad339108e672a2f973bf276bd5d2c.zip
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
Diffstat (limited to 'tools')
-rw-r--r--tools/objtool/check.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4350be739f4f..4b7c8b33069e 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;