diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-01-12 21:41:32 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-01-12 21:41:32 +0100 |
commit | cf4d5be89c0ad339108e672a2f973bf276bd5d2c (patch) | |
tree | d50ccc4fe07f2e16578d390f7f5418a010a23106 /tools | |
parent | Merge tag 'urgent-nolibc.2023.01.09a' of git://git.kernel.org/pub/scm/linux/k... (diff) | |
parent | objtool: Tolerate STT_NOTYPE symbols at end of section (diff) | |
download | linux-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.c | 9 |
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; |