File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
#define __UNIQUE_ID (prefix ) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
19
19
20
- #define randomized_struct_fields_start struct {
21
- #define randomized_struct_fields_end };
22
-
23
20
/* Clang doesn't have a way to turn it off per-function, yet. */
24
21
#ifdef __noretpoline
25
22
#undef __noretpoline
Original file line number Diff line number Diff line change 229
229
#ifdef RANDSTRUCT_PLUGIN
230
230
#define __randomize_layout __attribute__((randomize_layout))
231
231
#define __no_randomize_layout __attribute__((no_randomize_layout))
232
+ /* This anon struct can add padding, so only enable it under randstruct. */
233
+ #define randomized_struct_fields_start struct {
234
+ #define randomized_struct_fields_end } __randomize_layout;
232
235
#endif
233
236
234
237
#endif /* GCC_VERSION >= 40500 */
243
246
*/
244
247
#define __visible __attribute__((externally_visible))
245
248
246
- /*
247
- * RANDSTRUCT_PLUGIN wants to use an anonymous struct, but it is only
248
- * possible since GCC 4.6. To provide as much build testing coverage
249
- * as possible, this is used for all GCC 4.6+ builds, and not just on
250
- * RANDSTRUCT_PLUGIN builds.
251
- */
252
- #define randomized_struct_fields_start struct {
253
- #define randomized_struct_fields_end } __randomize_layout;
254
-
255
249
#endif /* GCC_VERSION >= 40600 */
256
250
257
251
You can’t perform that action at this time.
0 commit comments