Commit 14db1f0
objtool: Ignore unreachable trap after call to noreturn functions
With CONFIG_UBSAN_TRAP enabled, the compiler may insert a trap
instruction after a call to a noreturn function. In this case, objtool
warns that the UD2 instruction is unreachable.
This is a behavior seen with Clang, from the oldest version capable of
building the mainline x64_64 kernel (9.0), to the latest experimental
version (12.0).
Objtool silences similar warnings (trap after dead end instructions), so
so expand that check to include dead end functions.
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Rong Chen <rong.a.chen@intel.com>
Cc: Marco Elver <elver@google.com>
Cc: Philip Li <philip.li@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: kasan-dev@googlegroups.com
Cc: x86@kernel.org
Cc: clang-built-linux@googlegroups.com
BugLink: ClangBuiltLinux#1148
Link: https://lore.kernel.org/lkml/CAKwvOdmptEpi8fiOyWUo=AiZJiX+Z+VHJOM2buLPrWsMTwLnyw@mail.gmail.com
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Ilie Halip <ilie.halip@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>1 parent 2b232a2 commit 14db1f0
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2638 | 2638 | | |
2639 | 2639 | | |
2640 | 2640 | | |
2641 | | - | |
| 2641 | + | |
2642 | 2642 | | |
2643 | 2643 | | |
| 2644 | + | |
2644 | 2645 | | |
2645 | 2646 | | |
2646 | 2647 | | |
| |||
2668 | 2669 | | |
2669 | 2670 | | |
2670 | 2671 | | |
| 2672 | + | |
| 2673 | + | |
2671 | 2674 | | |
2672 | | - | |
| 2675 | + | |
| 2676 | + | |
2673 | 2677 | | |
2674 | 2678 | | |
2675 | 2679 | | |
| |||
2796 | 2800 | | |
2797 | 2801 | | |
2798 | 2802 | | |
2799 | | - | |
| 2803 | + | |
2800 | 2804 | | |
2801 | 2805 | | |
2802 | 2806 | | |
| |||
0 commit comments