]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Fix noinstr vs KCOV
authorPeter Zijlstra <peterz@infradead.org>
Fri, 12 Jun 2020 14:05:26 +0000 (16:05 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 18 Jun 2020 15:36:33 +0000 (17:36 +0200)
commitf5270568b23eec05dc4167d34c9bbaca386f4e78
tree5ef3755754810974096c758d5878dc31d23d7c20
parent6fcbe3b2e809b1ad32dd1812a01d7e92b9becabc
objtool: Fix noinstr vs KCOV

Since many compilers cannot disable KCOV with a function attribute,
help it to NOP out any __sanitizer_cov_*() calls injected in noinstr
code.

This turns:

12:   e8 00 00 00 00          callq  17 <lockdep_hardirqs_on+0x17>
13: R_X86_64_PLT32      __sanitizer_cov_trace_pc-0x4

into:

12:   0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
13: R_X86_64_NONE      __sanitizer_cov_trace_pc-0x4

Just like recordmcount does.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Dmitry Vyukov <dvyukov@google.com>
arch/x86/Kconfig
tools/objtool/arch.h
tools/objtool/arch/x86/decode.c
tools/objtool/arch/x86/include/arch_elf.h [new file with mode: 0644]
tools/objtool/check.c