diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-06-18 17:55:29 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-06-18 17:55:29 +0200 |
commit | d832c0051f4e9cc7d26ef3bc6e9b662bc6a90f3a (patch) | |
tree | f7980a9c140174713b703851d06ed61283631e13 /tools/objtool/arch | |
parent | Merge branch 'objtool/core' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff) | |
parent | objtool: Fix noinstr vs KCOV (diff) | |
download | linux-d832c0051f4e9cc7d26ef3bc6e9b662bc6a90f3a.tar.xz linux-d832c0051f4e9cc7d26ef3bc6e9b662bc6a90f3a.zip |
Merge branch 'objtool/urgent' into objtool/core
Conflicts:
tools/objtool/elf.c
tools/objtool/elf.h
tools/objtool/orc_gen.c
tools/objtool/check.c
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'tools/objtool/arch')
-rw-r--r-- | tools/objtool/arch/x86/decode.c | 18 | ||||
-rw-r--r-- | tools/objtool/arch/x86/include/arch_elf.h | 6 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index fe83d4c92825..1967370440b3 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -565,3 +565,21 @@ void arch_initial_func_cfi_state(struct cfi_init_state *state) state->regs[16].base = CFI_CFA; state->regs[16].offset = -8; } + +const char *arch_nop_insn(int len) +{ + static const char nops[5][5] = { + /* 1 */ { 0x90 }, + /* 2 */ { 0x66, 0x90 }, + /* 3 */ { 0x0f, 0x1f, 0x00 }, + /* 4 */ { 0x0f, 0x1f, 0x40, 0x00 }, + /* 5 */ { 0x0f, 0x1f, 0x44, 0x00, 0x00 }, + }; + + if (len < 1 || len > 5) { + WARN("invalid NOP size: %d\n", len); + return NULL; + } + + return nops[len-1]; +} diff --git a/tools/objtool/arch/x86/include/arch_elf.h b/tools/objtool/arch/x86/include/arch_elf.h new file mode 100644 index 000000000000..69cc4264b28a --- /dev/null +++ b/tools/objtool/arch/x86/include/arch_elf.h @@ -0,0 +1,6 @@ +#ifndef _OBJTOOL_ARCH_ELF +#define _OBJTOOL_ARCH_ELF + +#define R_NONE R_X86_64_NONE + +#endif /* _OBJTOOL_ARCH_ELF */ |