Skip to content

Commit 5567c6c

Browse files
Julien Thierryjpoimboe
authored andcommitted
objtool: Only include valid definitions depending on source file type
Header include/linux/objtool.h contains both C and assembly definition that are visible regardless of the file including them. Place definition under conditional __ASSEMBLY__. Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Julien Thierry <jthierry@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
1 parent 00089c0 commit 5567c6c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

include/linux/objtool.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#define _LINUX_OBJTOOL_H
44

55
#ifdef CONFIG_STACK_VALIDATION
6+
7+
#ifndef __ASSEMBLY__
68
/*
79
* This macro marks the given function's stack frame as "non-standard", which
810
* tells objtool to ignore the function when doing stack metadata validation.
@@ -15,6 +17,8 @@
1517
static void __used __section(.discard.func_stack_frame_non_standard) \
1618
*__func_stack_frame_non_standard_##func = func
1719

20+
#else /* __ASSEMBLY__ */
21+
1822
/*
1923
* This macro indicates that the following intra-function call is valid.
2024
* Any non-annotated intra-function call will cause objtool to issue a warning.
@@ -25,6 +29,8 @@
2529
.long 999b; \
2630
.popsection;
2731

32+
#endif /* __ASSEMBLY__ */
33+
2834
#else /* !CONFIG_STACK_VALIDATION */
2935

3036
#define STACK_FRAME_NON_STANDARD(func)

0 commit comments

Comments
 (0)