diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-08 17:37:32 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-08 17:37:32 -0500 |
| commit | 4ed8244ef8847c8ad7414e1a12ba45fef7998721 (patch) | |
| tree | 3edcbbb546bf5d8c00c51053c0a344ae5e81942d /scripts/gcc-plugins/randomize_layout_plugin.c | |
| parent | a0f79386a4968b4925da6db2d1daffd0605a4402 (diff) | |
| parent | b86729109c5fd0a480300f40608aac68764b5adf (diff) | |
Merge tag 'gcc-plugins-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull gcc plugins updates from Kees Cook:
- update includes for gcc 8 (Valdis Kletnieks)
- update initializers for gcc 8
* tag 'gcc-plugins-v4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
gcc-plugins: Use dynamic initializers
gcc-plugins: Add include required by GCC release 8
Diffstat (limited to 'scripts/gcc-plugins/randomize_layout_plugin.c')
| -rw-r--r-- | scripts/gcc-plugins/randomize_layout_plugin.c | 75 |
1 files changed, 21 insertions, 54 deletions
diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c index 0073af326449..c4a345c3715b 100644 --- a/scripts/gcc-plugins/randomize_layout_plugin.c +++ b/scripts/gcc-plugins/randomize_layout_plugin.c | |||
| @@ -580,68 +580,35 @@ static void finish_type(void *event_data, void *data) | |||
| 580 | return; | 580 | return; |
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | static struct attribute_spec randomize_layout_attr = { | 583 | static struct attribute_spec randomize_layout_attr = { }; |
| 584 | .name = "randomize_layout", | 584 | static struct attribute_spec no_randomize_layout_attr = { }; |
| 585 | // related to args | 585 | static struct attribute_spec randomize_considered_attr = { }; |
| 586 | .min_length = 0, | 586 | static struct attribute_spec randomize_performed_attr = { }; |
| 587 | .max_length = 0, | ||
| 588 | .decl_required = false, | ||
| 589 | // need type declaration | ||
| 590 | .type_required = true, | ||
| 591 | .function_type_required = false, | ||
| 592 | .handler = handle_randomize_layout_attr, | ||
| 593 | #if BUILDING_GCC_VERSION >= 4007 | ||
| 594 | .affects_type_identity = true | ||
| 595 | #endif | ||
| 596 | }; | ||
| 597 | 587 | ||
| 598 | static struct attribute_spec no_randomize_layout_attr = { | 588 | static void register_attributes(void *event_data, void *data) |
| 599 | .name = "no_randomize_layout", | 589 | { |
| 600 | // related to args | 590 | randomize_layout_attr.name = "randomize_layout"; |
| 601 | .min_length = 0, | 591 | randomize_layout_attr.type_required = true; |
| 602 | .max_length = 0, | 592 | randomize_layout_attr.handler = handle_randomize_layout_attr; |
| 603 | .decl_required = false, | ||
| 604 | // need type declaration | ||
| 605 | .type_required = true, | ||
| 606 | .function_type_required = false, | ||
| 607 | .handler = handle_randomize_layout_attr, | ||
| 608 | #if BUILDING_GCC_VERSION >= 4007 | 593 | #if BUILDING_GCC_VERSION >= 4007 |
| 609 | .affects_type_identity = true | 594 | randomize_layout_attr.affects_type_identity = true; |
| 610 | #endif | 595 | #endif |
| 611 | }; | ||
| 612 | 596 | ||
| 613 | static struct attribute_spec randomize_considered_attr = { | 597 | no_randomize_layout_attr.name = "no_randomize_layout"; |
| 614 | .name = "randomize_considered", | 598 | no_randomize_layout_attr.type_required = true; |
| 615 | // related to args | 599 | no_randomize_layout_attr.handler = handle_randomize_layout_attr; |
| 616 | .min_length = 0, | ||
| 617 | .max_length = 0, | ||
| 618 | .decl_required = false, | ||
| 619 | // need type declaration | ||
| 620 | .type_required = true, | ||
| 621 | .function_type_required = false, | ||
| 622 | .handler = handle_randomize_considered_attr, | ||
| 623 | #if BUILDING_GCC_VERSION >= 4007 | 600 | #if BUILDING_GCC_VERSION >= 4007 |
| 624 | .affects_type_identity = false | 601 | no_randomize_layout_attr.affects_type_identity = true; |
| 625 | #endif | 602 | #endif |
| 626 | }; | ||
| 627 | 603 | ||
| 628 | static struct attribute_spec randomize_performed_attr = { | 604 | randomize_considered_attr.name = "randomize_considered"; |
| 629 | .name = "randomize_performed", | 605 | randomize_considered_attr.type_required = true; |
| 630 | // related to args | 606 | randomize_considered_attr.handler = handle_randomize_considered_attr; |
| 631 | .min_length = 0, | 607 | |
| 632 | .max_length = 0, | 608 | randomize_performed_attr.name = "randomize_performed"; |
| 633 | .decl_required = false, | 609 | randomize_performed_attr.type_required = true; |
| 634 | // need type declaration | 610 | randomize_performed_attr.handler = handle_randomize_performed_attr; |
| 635 | .type_required = true, | ||
| 636 | .function_type_required = false, | ||
| 637 | .handler = handle_randomize_performed_attr, | ||
| 638 | #if BUILDING_GCC_VERSION >= 4007 | ||
| 639 | .affects_type_identity = false | ||
| 640 | #endif | ||
| 641 | }; | ||
| 642 | 611 | ||
| 643 | static void register_attributes(void *event_data, void *data) | ||
| 644 | { | ||
| 645 | register_attribute(&randomize_layout_attr); | 612 | register_attribute(&randomize_layout_attr); |
| 646 | register_attribute(&no_randomize_layout_attr); | 613 | register_attribute(&no_randomize_layout_attr); |
| 647 | register_attribute(&randomize_considered_attr); | 614 | register_attribute(&randomize_considered_attr); |
