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

objtool: Split out arch-specific CFI definitions

Some CFI definitions used by generic objtool code have no reason to vary
from one architecture to another. Keep those definitions in generic
code and move the arch-specific ones to a new arch-specific header.

Signed-off-by: Julien Thierry <jthierry@redhat.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Julien Thierry and committed by
Ingo Molnar
6f8ca676 bfb08f22

+29 -20
+2 -1
tools/objtool/Makefile
··· 35 35 36 36 INCLUDES := -I$(srctree)/tools/include \ 37 37 -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ 38 - -I$(srctree)/tools/arch/$(SRCARCH)/include 38 + -I$(srctree)/tools/arch/$(SRCARCH)/include \ 39 + -I$(srctree)/tools/objtool/arch/$(SRCARCH)/include 39 40 WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed 40 41 CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS) 41 42 LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
+25
tools/objtool/arch/x86/include/cfi_regs.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + 3 + #ifndef _OBJTOOL_CFI_REGS_H 4 + #define _OBJTOOL_CFI_REGS_H 5 + 6 + #define CFI_AX 0 7 + #define CFI_DX 1 8 + #define CFI_CX 2 9 + #define CFI_BX 3 10 + #define CFI_SI 4 11 + #define CFI_DI 5 12 + #define CFI_BP 6 13 + #define CFI_SP 7 14 + #define CFI_R8 8 15 + #define CFI_R9 9 16 + #define CFI_R10 10 17 + #define CFI_R11 11 18 + #define CFI_R12 12 19 + #define CFI_R13 13 20 + #define CFI_R14 14 21 + #define CFI_R15 15 22 + #define CFI_RA 16 23 + #define CFI_NUM_REGS 17 24 + 25 + #endif /* _OBJTOOL_CFI_REGS_H */
+2 -19
tools/objtool/cfi.h
··· 6 6 #ifndef _OBJTOOL_CFI_H 7 7 #define _OBJTOOL_CFI_H 8 8 9 + #include "cfi_regs.h" 10 + 9 11 #define CFI_UNDEFINED -1 10 12 #define CFI_CFA -2 11 13 #define CFI_SP_INDIRECT -3 12 14 #define CFI_BP_INDIRECT -4 13 - 14 - #define CFI_AX 0 15 - #define CFI_DX 1 16 - #define CFI_CX 2 17 - #define CFI_BX 3 18 - #define CFI_SI 4 19 - #define CFI_DI 5 20 - #define CFI_BP 6 21 - #define CFI_SP 7 22 - #define CFI_R8 8 23 - #define CFI_R9 9 24 - #define CFI_R10 10 25 - #define CFI_R11 11 26 - #define CFI_R12 12 27 - #define CFI_R13 13 28 - #define CFI_R14 14 29 - #define CFI_R15 15 30 - #define CFI_RA 16 31 - #define CFI_NUM_REGS 17 32 15 33 16 struct cfi_reg { 34 17 int base;