Skip to content

Commit 592c358

Browse files
committed
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
2 parents 82ff316 + 7e50163 commit 592c358

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tools/objtool/check.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,6 +1976,14 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
19761976
reloc_addend(reloc) == pfunc->offset)
19771977
break;
19781978

1979+
/*
1980+
* Clang sometimes leaves dangling unused jump table entries
1981+
* which point to the end of the function. Ignore them.
1982+
*/
1983+
if (reloc->sym->sec == pfunc->sec &&
1984+
reloc_addend(reloc) == pfunc->offset + pfunc->len)
1985+
goto next;
1986+
19791987
dest_insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
19801988
if (!dest_insn)
19811989
break;
@@ -1993,6 +2001,7 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
19932001
alt->insn = dest_insn;
19942002
alt->next = insn->alts;
19952003
insn->alts = alt;
2004+
next:
19962005
prev_offset = reloc_offset(reloc);
19972006
}
19982007

@@ -2265,7 +2274,7 @@ static int read_annotate(struct objtool_file *file,
22652274

22662275
if (sec->sh.sh_entsize != 8) {
22672276
static bool warned = false;
2268-
if (!warned) {
2277+
if (!warned && opts.verbose) {
22692278
WARN("%s: dodgy linker, sh_entsize != 8", sec->name);
22702279
warned = true;
22712280
}

0 commit comments

Comments
 (0)