mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-09 11:00:49 +01:00
The '__unreachable' and '__func_stack_frame_non_standard' sections are
only used at compile time. They're discarded for vmlinux but they
should also be discarded for modules.
Since this is a recurring pattern, prefix the section names with
".discard.". It's a nice convention and vmlinux.lds.h already discards
such sections.
Also remove the 'a' (allocatable) flag from the __unreachable section
since it doesn't make sense for a discarded section.
Suggested-by: Linus Torvalds <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Jessica Yu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: d1091c7fa3 ("objtool: Improve detection of BUG() and other dead ends")
Link: http://lkml.kernel.org/r/20170301180444.lhd53c5tibc4ns77@treble
Signed-off-by: Ingo Molnar <[email protected]>
24 lines
774 B
C
24 lines
774 B
C
#ifndef _LINUX_FRAME_H
|
|
#define _LINUX_FRAME_H
|
|
|
|
#ifdef CONFIG_STACK_VALIDATION
|
|
/*
|
|
* This macro marks the given function's stack frame as "non-standard", which
|
|
* tells objtool to ignore the function when doing stack metadata validation.
|
|
* It should only be used in special cases where you're 100% sure it won't
|
|
* affect the reliability of frame pointers and kernel stack traces.
|
|
*
|
|
* For more information, see tools/objtool/Documentation/stack-validation.txt.
|
|
*/
|
|
#define STACK_FRAME_NON_STANDARD(func) \
|
|
static void __used __section(.discard.func_stack_frame_non_standard) \
|
|
*__func_stack_frame_non_standard_##func = func
|
|
|
|
#else /* !CONFIG_STACK_VALIDATION */
|
|
|
|
#define STACK_FRAME_NON_STANDARD(func)
|
|
|
|
#endif /* CONFIG_STACK_VALIDATION */
|
|
|
|
#endif /* _LINUX_FRAME_H */
|