hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/tools/include/linux/objtool.h
....@@ -71,6 +71,23 @@
7171 static void __used __section(".discard.func_stack_frame_non_standard") \
7272 *__func_stack_frame_non_standard_##func = func
7373
74
+/*
75
+ * STACK_FRAME_NON_STANDARD_FP() is a frame-pointer-specific function ignore
76
+ * for the case where a function is intentionally missing frame pointer setup,
77
+ * but otherwise needs objtool/ORC coverage when frame pointers are disabled.
78
+ */
79
+#ifdef CONFIG_FRAME_POINTER
80
+#define STACK_FRAME_NON_STANDARD_FP(func) STACK_FRAME_NON_STANDARD(func)
81
+#else
82
+#define STACK_FRAME_NON_STANDARD_FP(func)
83
+#endif
84
+
85
+#define ANNOTATE_NOENDBR \
86
+ "986: \n\t" \
87
+ ".pushsection .discard.noendbr\n\t" \
88
+ _ASM_PTR " 986b\n\t" \
89
+ ".popsection\n\t"
90
+
7491 #else /* __ASSEMBLY__ */
7592
7693 /*
....@@ -117,6 +134,13 @@
117134 .popsection
118135 .endm
119136
137
+.macro ANNOTATE_NOENDBR
138
+.Lhere_\@:
139
+ .pushsection .discard.noendbr
140
+ .quad .Lhere_\@
141
+ .popsection
142
+.endm
143
+
120144 #endif /* __ASSEMBLY__ */
121145
122146 #else /* !CONFIG_STACK_VALIDATION */
....@@ -126,10 +150,14 @@
126150 #define UNWIND_HINT(sp_reg, sp_offset, type, end) \
127151 "\n\t"
128152 #define STACK_FRAME_NON_STANDARD(func)
153
+#define STACK_FRAME_NON_STANDARD_FP(func)
154
+#define ANNOTATE_NOENDBR
129155 #else
130156 #define ANNOTATE_INTRA_FUNCTION_CALL
131157 .macro UNWIND_HINT type:req sp_reg=0 sp_offset=0 end=0
132158 .endm
159
+.macro ANNOTATE_NOENDBR
160
+.endm
133161 #endif
134162
135163 #endif /* CONFIG_STACK_VALIDATION */