diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-02-16 10:30:58 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-02-16 10:30:58 -0800 |
commit | 592c358ea963d7227e3e7b8ace91b2b5dd81f6cb (patch) | |
tree | c2d130b5b8eb8f8e6da0ac95fcb075214e4fc876 /tools/objtool | |
parent | 82ff31645685559e3732f7143538c9fe88221453 (diff) | |
parent | 7e501637bd5b702a2fa627e903a0025654110e1e (diff) |
Merge tag 'objtool_urgent_for_v6.14_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fixes from Borislav Petkov:
- Move a warning about a lld.ld breakage into the verbose setting as
said breakage has been fixed in the meantime
- Teach objtool to ignore dangling jump table entries added by Clang
* tag 'objtool_urgent_for_v6.14_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Move dodgy linker warn to verbose
objtool: Ignore dangling jump table entries
Diffstat (limited to 'tools/objtool')
-rw-r--r-- | tools/objtool/check.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index a027d1c0bb2b..be18a0489303 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1976,6 +1976,14 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, reloc_addend(reloc) == pfunc->offset) break; + /* + * Clang sometimes leaves dangling unused jump table entries + * which point to the end of the function. Ignore them. + */ + if (reloc->sym->sec == pfunc->sec && + reloc_addend(reloc) == pfunc->offset + pfunc->len) + goto next; + dest_insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc)); if (!dest_insn) break; @@ -1993,6 +2001,7 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, alt->insn = dest_insn; alt->next = insn->alts; insn->alts = alt; +next: prev_offset = reloc_offset(reloc); } @@ -2265,7 +2274,7 @@ static int read_annotate(struct objtool_file *file, if (sec->sh.sh_entsize != 8) { static bool warned = false; - if (!warned) { + if (!warned && opts.verbose) { WARN("%s: dodgy linker, sh_entsize != 8", sec->name); warned = true; } |