Skip to content

Commit eeff7ac

Browse files
jpoimboeIngo Molnar
authored andcommitted
objtool: Warn when disabling unreachable warnings
Print a warning when disabling the unreachable warnings (due to a GCC bug). This will help determine if recent GCCs still have the issue and alert us if any other issues might be silently lurking behind the unreachable disablement. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/df243063787596e6031367e6659e7e43409d6c6d.1742852846.git.jpoimboe@kernel.org
1 parent ef753d6 commit eeff7ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/objtool/arch/x86/special.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <objtool/special.h>
55
#include <objtool/builtin.h>
6+
#include <objtool/warn.h>
67

78
#define X86_FEATURE_POPCNT (4 * 32 + 23)
89
#define X86_FEATURE_SMAP (9 * 32 + 20)
@@ -156,8 +157,10 @@ struct reloc *arch_find_switch_table(struct objtool_file *file,
156157
* indicates a rare GCC quirk/bug which can leave dead
157158
* code behind.
158159
*/
159-
if (reloc_type(text_reloc) == R_X86_64_PC32)
160+
if (reloc_type(text_reloc) == R_X86_64_PC32) {
161+
WARN_INSN(insn, "ignoring unreachables due to jump table quirk");
160162
file->ignore_unreachables = true;
163+
}
161164

162165
*table_size = 0;
163166
return rodata_reloc;

0 commit comments

Comments
 (0)