Commit 87116ae6 authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

objtool: Fix ANNOTATE_REACHABLE to be a normal annotation



Currently REACHABLE is weird for being on the instruction after the
instruction it modifies.

Since all REACHABLE annotations have an explicit instruction, flip
them around.

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
Link: https://lore.kernel.org/r/20241128094312.494176035@infradead.org
parent e7a174fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@
#define __WARN_FLAGS(flags)					\
do {								\
	instrumentation_begin();				\
	__BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE);\
	__BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\
	instrumentation_end();					\
} while (0)

+2 −3
Original line number Diff line number Diff line
@@ -308,10 +308,9 @@ SYM_CODE_END(xen_error_entry)
		movq	$-1, ORIG_RAX(%rsp)	/* no syscall to restart */
	.endif

	call	\cfunc

	/* For some configurations \cfunc ends up being a noreturn. */
	ANNOTATE_REACHABLE
	call	\cfunc

	jmp	error_return
.endm
@@ -529,10 +528,10 @@ SYM_CODE_START(\asmsym)
	movq	%rsp, %rdi		/* pt_regs pointer into first argument */
	movq	ORIG_RAX(%rsp), %rsi	/* get error code into 2nd argument*/
	movq	$-1, ORIG_RAX(%rsp)	/* no syscall to restart */
	call	\cfunc

	/* For some configurations \cfunc ends up being a noreturn. */
	ANNOTATE_REACHABLE
	call	\cfunc

	jmp	paranoid_exit

+1 −1
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@ do { \
do {								\
	__auto_type __flags = BUGFLAG_WARNING|(flags);		\
	instrumentation_begin();				\
	_BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE);	\
	_BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE(1b));	\
	instrumentation_end();					\
} while (0)

+2 −2
Original line number Diff line number Diff line
@@ -100,8 +100,8 @@
}

#define ASM_CALL_ARG0							\
	"call %c[__func]				\n"		\
	ANNOTATE_REACHABLE
	"1: call %c[__func]				\n"		\
	ANNOTATE_REACHABLE(1b)

#define ASM_CALL_ARG1							\
	"movq	%[arg1], %%rdi				\n"		\
+2 −2
Original line number Diff line number Diff line
@@ -177,11 +177,11 @@
 */
#define ANNOTATE_UNRET_BEGIN		ASM_ANNOTATE(ANNOTYPE_UNRET_BEGIN)
/*
 * This should be used directly after an instruction that is considered
 * This should be used to refer to an instruction that is considered
 * terminating, like a noreturn CALL or UD2 when we know they are not -- eg
 * WARN using UD2.
 */
#define ANNOTATE_REACHABLE		ASM_ANNOTATE(ANNOTYPE_REACHABLE)
#define ANNOTATE_REACHABLE(label)	__ASM_ANNOTATE(label, ANNOTYPE_REACHABLE)

#else
#define ANNOTATE_NOENDBR		ANNOTATE type=ANNOTYPE_NOENDBR
Loading