Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

objtool: Move macros describing structures to arch-dependent code

Some macros are defined to describe the size and layout of structures
exception_table_entry, jump_entry and alt_instr. These values can vary
from one architecture to another.

Have the values be defined by arch specific code.

Suggested-by: Raphael Gault <raphael.gault@arm.com>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>

authored by

Julien Thierry and committed by
Josh Poimboeuf
c8ea0d67 bb090fdb

+21 -15
+20
tools/objtool/arch/x86/include/arch_special.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + #ifndef _X86_ARCH_SPECIAL_H 3 + #define _X86_ARCH_SPECIAL_H 4 + 5 + #define EX_ENTRY_SIZE 12 6 + #define EX_ORIG_OFFSET 0 7 + #define EX_NEW_OFFSET 4 8 + 9 + #define JUMP_ENTRY_SIZE 16 10 + #define JUMP_ORIG_OFFSET 0 11 + #define JUMP_NEW_OFFSET 4 12 + 13 + #define ALT_ENTRY_SIZE 13 14 + #define ALT_ORIG_OFFSET 0 15 + #define ALT_NEW_OFFSET 4 16 + #define ALT_FEATURE_OFFSET 8 17 + #define ALT_ORIG_LEN_OFFSET 10 18 + #define ALT_NEW_LEN_OFFSET 11 19 + 20 + #endif /* _X86_ARCH_SPECIAL_H */
+1 -15
tools/objtool/special.c
··· 14 14 #include "builtin.h" 15 15 #include "special.h" 16 16 #include "warn.h" 17 - 18 - #define EX_ENTRY_SIZE 12 19 - #define EX_ORIG_OFFSET 0 20 - #define EX_NEW_OFFSET 4 21 - 22 - #define JUMP_ENTRY_SIZE 16 23 - #define JUMP_ORIG_OFFSET 0 24 - #define JUMP_NEW_OFFSET 4 25 - 26 - #define ALT_ENTRY_SIZE 13 27 - #define ALT_ORIG_OFFSET 0 28 - #define ALT_NEW_OFFSET 4 29 - #define ALT_FEATURE_OFFSET 8 30 - #define ALT_ORIG_LEN_OFFSET 10 31 - #define ALT_NEW_LEN_OFFSET 11 17 + #include "arch_special.h" 32 18 33 19 #define X86_FEATURE_POPCNT (4*32+23) 34 20 #define X86_FEATURE_SMAP (9*32+20)