kernel_optimize_test/tools/objtool
Peter Zijlstra 7ea0731957 objtool: Teach get_alt_entry() about more relocation types
commit 24ff652573754fe4c03213ebd26b17e86842feb3 upstream.

Occasionally objtool encounters symbol (as opposed to section)
relocations in .altinstructions. Typically they are the alternatives
written by elf_add_alternative() as encountered on a noinstr
validation run on vmlinux after having already ran objtool on the
individual .o files.

Basically this is the counterpart of commit 44f6a7c0755d ("objtool:
Fix seg fault with Clang non-section symbols"), because when these new
assemblers (binutils now also does this) strip the section symbols,
elf_add_reloc_to_insn() is forced to emit symbol based relocations.

As such, teach get_alt_entry() about different relocation types.

Fixes: 9bc0bb50727c ("objtool/x86: Rewrite retpoline thunk calls")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/YVWUvknIEVNkPvnP@hirez.programming.kicks-ass.net
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-25 11:26:20 +02:00
..
arch/x86 objtool: Don't make .altinstructions writable 2022-07-25 11:26:20 +02:00
Documentation objtool: Support stack layout changes in alternatives 2022-07-25 11:26:06 +02:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
arch.h objtool: Keep track of retpoline call sites 2022-07-25 11:26:17 +02:00
Build objtool: Enable compilation of objtool for all architectures 2020-05-20 09:17:28 -05:00
builtin-check.c objtool: Move ORC logic out of check() 2020-09-01 17:19:11 -05:00
builtin-orc.c objtool: Refactor ORC section generation 2022-07-25 11:26:05 +02:00
builtin.h objtool: Implement noinstr validation 2020-04-22 10:53:50 +02:00
cfi.h objtool: Fix !CFI insn_state propagation 2020-04-22 10:53:50 +02:00
check.c objtool: Support asm jump tables 2022-07-25 11:26:18 +02:00
check.h objtool: Cache instruction relocs 2022-07-25 11:26:17 +02:00
elf.c objtool: Fix .symtab_shndx handling for elf_create_undef_symbol() 2022-07-25 11:26:19 +02:00
elf.h objtool: Add elf_create_undef_symbol() 2022-07-25 11:26:16 +02:00
Makefile objtool: Refactor ORC section generation 2022-07-25 11:26:05 +02:00
objtool.c objtool: Keep track of retpoline call sites 2022-07-25 11:26:17 +02:00
objtool.h objtool: Keep track of retpoline call sites 2022-07-25 11:26:17 +02:00
orc_dump.c objtool: Make unwind hint definitions available to other architectures 2020-09-10 10:43:13 -05:00
orc_gen.c objtool: Create reloc sections implicitly 2022-07-25 11:26:15 +02:00
special.c objtool: Teach get_alt_entry() about more relocation types 2022-07-25 11:26:20 +02:00
special.h objtool: Refactor jump table code to support other architectures 2020-09-10 10:43:13 -05:00
sync-check.sh x86/insn: Add a __ignore_sync_check__ marker 2022-07-25 11:26:11 +02:00
warn.h objtool: Rename find_containing_func() 2020-03-25 18:28:29 +01:00
weak.c objtool: Refactor ORC section generation 2022-07-25 11:26:05 +02:00