diff options
| author | Ard Biesheuvel <ardb@kernel.org> | 2024-10-11 19:08:50 +0200 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2024-12-02 12:24:29 +0100 |
| commit | c3cb6c158c64dc39838208d51dcd06d1990b371d (patch) | |
| tree | 9ef9e5ed45de26f53bc839aeaac057ff04ce1b93 /tools/objtool/arch/x86 | |
| parent | e7e0eb53c2f0f68fe2577472ce2802a4efd9d7ce (diff) | |
objtool: Allow arch code to discover jump table size
In preparation for adding support for annotated jump tables, where
ELF relocations and symbols are used to describe the locations of jump
tables in the executable, refactor the jump table discovery logic so the
table size can be returned from arch_find_switch_table().
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20241011170847.334429-12-ardb+git@google.com
Diffstat (limited to 'tools/objtool/arch/x86')
| -rw-r--r-- | tools/objtool/arch/x86/special.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/objtool/arch/x86/special.c b/tools/objtool/arch/x86/special.c index 4ea0f9815fda..9c1c9df09aaa 100644 --- a/tools/objtool/arch/x86/special.c +++ b/tools/objtool/arch/x86/special.c @@ -109,7 +109,8 @@ bool arch_support_alt_relocation(struct special_alt *special_alt, * NOTE: MITIGATION_RETPOLINE made it harder still to decode dynamic jumps. */ struct reloc *arch_find_switch_table(struct objtool_file *file, - struct instruction *insn) + struct instruction *insn, + unsigned long *table_size) { struct reloc *text_reloc, *rodata_reloc; struct section *table_sec; @@ -158,5 +159,6 @@ struct reloc *arch_find_switch_table(struct objtool_file *file, if (reloc_type(text_reloc) == R_X86_64_PC32) file->ignore_unreachables = true; + *table_size = 0; return rodata_reloc; } |
