aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2008-07-30 18:03:49 -0400
committerSam Ravnborg <sam@ravnborg.org>2008-07-31 17:00:25 -0400
commit94aa3d716ee0244cc5b9f2ab3745aed5fdfa30e0 (patch)
tree0003889647cfdbabb5db12555eb5967177e226fc /scripts
parent11ddad396086f8d1dfcb0056dc9d65d228f755c1 (diff)
kbuild: genksyms parser: fix the __attribute__ rule
We are having two kinds of problems with genksyms today: fake checksum changes without actual ABI changes, and changes which we would rather like to ignore (such as an additional field at the end of a structure that modules are not supposed to touch, for example). I have thought about ways to improve genksyms and compute checksums differently to avoid those problems, but in the end I don't see a fundamentally better way. So here are some genksyms patches for at least making the checksums more easily manageable, if we cannot fully fix them. In addition to the bugfixes (the first two patches), this allows genksyms to track checksum changes and report why a checksum changed (third patch), and to selectively ignore changes (fourth patch). This patch: Gcc __attribute__ definitions may occur repeatedly, e.g., static int foo __attribute__((__used__)) __attribute__((aligned (16))); The genksyms parser does not understand this, and generates a syntax error. Fix this case. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genksyms/parse.c_shipped144
-rw-r--r--scripts/genksyms/parse.y2
2 files changed, 73 insertions, 73 deletions
diff --git a/scripts/genksyms/parse.c_shipped b/scripts/genksyms/parse.c_shipped
index 3e6079f36b9f..eaee44e66a43 100644
--- a/scripts/genksyms/parse.c_shipped
+++ b/scripts/genksyms/parse.c_shipped
@@ -504,7 +504,7 @@ static const yytype_uint16 yyprhs[] =
504 239, 242, 245, 247, 248, 250, 252, 257, 262, 265, 504 239, 242, 245, 247, 248, 250, 252, 257, 262, 265,
505 269, 273, 277, 278, 280, 283, 287, 291, 292, 294, 505 269, 273, 277, 278, 280, 283, 287, 291, 292, 294,
506 296, 299, 303, 306, 307, 309, 311, 315, 318, 321, 506 296, 299, 303, 306, 307, 309, 311, 315, 318, 321,
507 323, 326, 327, 329, 332, 333, 335 507 323, 326, 327, 330, 333, 334, 336
508}; 508};
509 509
510/* YYRHS -- A `-1'-separated list of the rules' RHS. */ 510/* YYRHS -- A `-1'-separated list of the rules' RHS. */
@@ -542,9 +542,9 @@ static const yytype_int8 yyrhs[] =
542 -1, -1, 89, -1, 90, -1, 89, 90, -1, 64, 542 -1, -1, 89, -1, 90, -1, 89, 90, -1, 64,
543 91, 44, -1, 1, 44, -1, -1, 92, -1, 93, 543 91, 44, -1, 1, 44, -1, -1, 92, -1, 93,
544 -1, 92, 46, 93, -1, 76, 95, -1, 37, 94, 544 -1, 92, 46, 93, -1, 76, 95, -1, 37, 94,
545 -1, 94, -1, 52, 34, -1, -1, 31, -1, 30, 545 -1, 94, -1, 52, 34, -1, -1, 95, 31, -1,
546 44, -1, -1, 30, -1, 29, 47, 37, 49, 44, 546 30, 44, -1, -1, 30, -1, 29, 47, 37, 49,
547 -1 547 44, -1
548}; 548};
549 549
550/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 550/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
@@ -647,7 +647,7 @@ static const yytype_uint8 yyr2[] =
647 2, 2, 1, 0, 1, 1, 4, 4, 2, 3, 647 2, 2, 1, 0, 1, 1, 4, 4, 2, 3,
648 3, 3, 0, 1, 2, 3, 3, 0, 1, 1, 648 3, 3, 0, 1, 2, 3, 3, 0, 1, 1,
649 2, 3, 2, 0, 1, 1, 3, 2, 2, 1, 649 2, 3, 2, 0, 1, 1, 3, 2, 2, 1,
650 2, 0, 1, 2, 0, 1, 5 650 2, 0, 2, 2, 0, 1, 5
651}; 651};
652 652
653/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 653/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -667,9 +667,9 @@ static const yytype_uint8 yydefact[] =
667 0, 66, 125, 101, 121, 71, 0, 7, 112, 106, 667 0, 66, 125, 101, 121, 71, 0, 7, 112, 106,
668 76, 77, 0, 0, 0, 121, 75, 0, 114, 115, 668 76, 77, 0, 0, 0, 121, 75, 0, 114, 115,
669 119, 105, 0, 110, 124, 0, 36, 0, 73, 72, 669 119, 105, 0, 110, 124, 0, 36, 0, 73, 72,
670 61, 20, 122, 102, 0, 93, 0, 84, 87, 88, 670 61, 20, 102, 0, 93, 0, 84, 87, 88, 118,
671 118, 0, 76, 0, 120, 74, 117, 80, 0, 111, 671 0, 76, 0, 120, 74, 117, 80, 0, 111, 0,
672 0, 35, 126, 0, 21, 103, 70, 94, 56, 0, 672 35, 126, 122, 0, 21, 103, 70, 94, 56, 0,
673 93, 90, 92, 69, 83, 0, 82, 81, 0, 0, 673 93, 90, 92, 69, 83, 0, 82, 81, 0, 0,
674 116, 104, 0, 95, 0, 91, 98, 0, 85, 89, 674 116, 104, 0, 95, 0, 91, 98, 0, 85, 89,
675 79, 78, 100, 99, 0, 0, 97, 96 675 79, 78, 100, 99, 0, 0, 97, 96
@@ -680,44 +680,44 @@ static const yytype_int16 yydefgoto[] =
680{ 680{
681 -1, 1, 2, 3, 35, 72, 55, 36, 64, 65, 681 -1, 1, 2, 3, 35, 72, 55, 36, 64, 65,
682 66, 75, 38, 39, 40, 41, 42, 67, 86, 87, 682 66, 75, 38, 39, 40, 41, 42, 67, 86, 87,
683 43, 114, 69, 105, 106, 126, 127, 128, 129, 151, 683 43, 114, 69, 105, 106, 125, 126, 127, 128, 151,
684 152, 44, 144, 145, 54, 76, 77, 78, 107, 108, 684 152, 44, 144, 145, 54, 76, 77, 78, 107, 108,
685 109, 110, 123, 45, 94, 46 685 109, 110, 122, 45, 94, 46
686}; 686};
687 687
688/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 688/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
689 STATE-NUM. */ 689 STATE-NUM. */
690#define YYPACT_NINF -135 690#define YYPACT_NINF -134
691static const yytype_int16 yypact[] = 691static const yytype_int16 yypact[] =
692{ 692{
693 -135, 11, -135, 312, -135, -135, 24, -135, -135, -135, 693 -134, 16, -134, 312, -134, -134, 20, -134, -134, -134,
694 -135, -135, -23, -135, -2, -135, -135, -135, -135, -135, 694 -134, -134, -18, -134, -3, -134, -134, -134, -134, -134,
695 -135, -135, -135, -135, -17, -135, -11, -135, -135, -135, 695 -134, -134, -134, -134, -26, -134, -25, -134, -134, -134,
696 -3, 16, 26, -135, -135, -135, -135, 34, 482, -135, 696 -7, 5, 27, -134, -134, -134, -134, 46, 482, -134,
697 -135, -135, -135, -135, -135, -135, -135, -135, -135, -135, 697 -134, -134, -134, -134, -134, -134, -134, -134, -134, -134,
698 -8, -135, 22, 97, -135, 482, 22, -135, 482, 56, 698 -8, -134, 30, 97, -134, 482, 30, -134, 482, 7,
699 -135, -135, 12, 10, 50, 49, -135, 34, -13, 15, 699 -134, -134, 12, 10, 42, 55, -134, 46, -15, 15,
700 -135, -135, 482, -135, 47, -25, 51, 145, -135, -135, 700 -134, -134, 482, -134, 25, 26, 47, 145, -134, -134,
701 34, -135, 356, 52, 71, 77, -135, 10, -135, -135, 701 46, -134, 356, 39, 71, 77, -134, 10, -134, -134,
702 34, -135, -135, -135, 68, -135, 193, -135, -135, -135, 702 46, -134, -134, -134, -134, -134, 193, -134, -134, -134,
703 48, -135, 6, 93, 37, 68, 18, 85, 84, -135, 703 75, -134, 6, 95, 43, -134, 28, 86, 85, -134,
704 -135, -135, 87, -135, 102, 86, -135, 89, -135, -135, 704 -134, -134, 88, -134, 103, 87, -134, 91, -134, -134,
705 -135, -135, -135, 90, 88, 401, 94, 100, 101, -135, 705 -134, -134, -23, 90, 401, 94, 101, 102, -134, -134,
706 -135, 99, -135, 108, -135, -135, -135, -135, 230, -135, 706 98, -134, 108, -134, -134, 109, -134, 230, -134, 26,
707 -25, -135, -135, 105, -135, -135, -135, -135, -135, 9, 707 -134, -134, -134, 134, -134, -134, -134, -134, -134, 9,
708 42, -135, 28, -135, -135, 445, -135, -135, 119, 125, 708 48, -134, 35, -134, -134, 445, -134, -134, 125, 126,
709 -135, -135, 126, -135, 128, -135, -135, 267, -135, -135, 709 -134, -134, 128, -134, 129, -134, -134, 267, -134, -134,
710 -135, -135, -135, -135, 129, 130, -135, -135 710 -134, -134, -134, -134, 130, 131, -134, -134
711}; 711};
712 712
713/* YYPGOTO[NTERM-NUM]. */ 713/* YYPGOTO[NTERM-NUM]. */
714static const yytype_int16 yypgoto[] = 714static const yytype_int16 yypgoto[] =
715{ 715{
716 -135, -135, 179, -135, -135, -135, -135, -47, -135, -135, 716 -134, -134, 180, -134, -134, -134, -134, -33, -134, -134,
717 91, 0, -58, -37, -135, -135, -135, -73, -135, -135, 717 93, 0, -58, -37, -134, -134, -134, -73, -134, -134,
718 -48, -32, -135, -38, -135, -134, -135, -135, 29, -63, 718 -54, -32, -134, -81, -134, -133, -134, -134, 29, -50,
719 -135, -135, -135, -135, -20, -135, -135, 106, -135, -135, 719 -134, -134, -134, -134, -20, -134, -134, 110, -134, -134,
720 45, 95, 82, -135, -135, -135 720 49, 96, 80, -134, -134, -134
721}; 721};
722 722
723/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 723/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -727,26 +727,26 @@ static const yytype_int16 yypgoto[] =
727#define YYTABLE_NINF -109 727#define YYTABLE_NINF -109
728static const yytype_int16 yytable[] = 728static const yytype_int16 yytable[] =
729{ 729{
730 82, 70, 104, 37, 159, 68, 57, 131, 79, 49, 730 82, 70, 104, 37, 159, 68, 57, 130, 142, 88,
731 162, 4, 100, 84, 50, 88, 101, 92, 10, 93, 731 162, 52, 56, 84, 49, 92, 4, 93, 10, 50,
732 52, 51, 102, 63, 71, 97, 56, 103, 20, 104, 732 51, 132, 79, 134, 71, 53, 53, 143, 20, 104,
733 85, 104, 73, 175, 53, 91, 81, 29, 125, 120, 733 85, 104, 73, 120, 175, 91, 81, 29, 124, 97,
734 53, 33, -93, 132, 58, 70, 147, 101, 95, 61, 734 58, 33, -93, 131, 83, 70, 147, 101, 95, 61,
735 163, 137, 150, 102, 63, 80, 149, 63, -93, 62, 735 163, 150, 59, 102, 63, 80, 149, 63, -93, 62,
736 63, 166, 96, 59, 133, 138, 135, 104, 47, 48, 736 63, 136, 96, 100, 47, 48, 104, 101, 166, 98,
737 60, 61, 80, 53, 132, 167, 150, 150, 101, 147, 737 99, 60, 80, 102, 63, 137, 150, 150, 103, 124,
738 125, 62, 63, 163, 102, 63, 164, 165, 70, 149, 738 131, 53, 167, 61, 101, 147, 89, 70, 117, 163,
739 63, 98, 99, 83, 89, 90, 111, 125, 74, 122, 739 102, 63, 111, 62, 63, 149, 63, 124, 74, 164,
740 103, 117, 7, 8, 9, 10, 11, 12, 13, 125, 740 165, 90, 7, 8, 9, 10, 11, 12, 13, 124,
741 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 741 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
742 118, 26, 27, 28, 29, 30, 119, 134, 33, 139, 742 118, 26, 27, 28, 29, 30, 119, 103, 33, 133,
743 140, 98, 92, 142, -22, 141, 154, 146, 34, 161, 743 138, 139, 98, 92, -22, 141, 140, 154, 34, 146,
744 143, -22, -107, 153, -22, -22, 112, 155, 156, -22, 744 142, -22, -107, 153, -22, -22, 112, 156, 155, -22,
745 7, 8, 9, 10, 11, 12, 13, 157, 15, 16, 745 7, 8, 9, 10, 11, 12, 13, 157, 15, 16,
746 17, 18, 19, 20, 21, 22, 23, 24, 170, 26, 746 17, 18, 19, 20, 21, 22, 23, 24, 161, 26,
747 27, 28, 29, 30, 171, 172, 33, 173, 176, 177, 747 27, 28, 29, 30, 170, 171, 33, 172, 173, 176,
748 5, 121, -22, 113, 169, 160, 34, 136, 0, -22, 748 177, 5, -22, 121, 169, 135, 34, 113, 160, -22,
749 -108, 0, -22, -22, 124, 130, 0, -22, 7, 8, 749 -108, 0, -22, -22, 123, 0, 129, -22, 7, 8,
750 9, 10, 11, 12, 13, 0, 15, 16, 17, 18, 750 9, 10, 11, 12, 13, 0, 15, 16, 17, 18,
751 19, 20, 21, 22, 23, 24, 0, 26, 27, 28, 751 19, 20, 21, 22, 23, 24, 0, 26, 27, 28,
752 29, 30, 0, 0, 33, 0, 0, 0, 0, -86, 752 29, 30, 0, 0, 33, 0, 0, 0, 0, -86,
@@ -784,26 +784,26 @@ static const yytype_int16 yytable[] =
784 784
785static const yytype_int16 yycheck[] = 785static const yytype_int16 yycheck[] =
786{ 786{
787 58, 38, 75, 3, 138, 37, 26, 1, 55, 32, 787 58, 38, 75, 3, 137, 37, 26, 1, 31, 63,
788 1, 0, 37, 1, 37, 63, 41, 30, 8, 32, 788 1, 37, 37, 1, 32, 30, 0, 32, 8, 37,
789 37, 23, 47, 48, 32, 72, 37, 52, 18, 102, 789 23, 102, 55, 104, 32, 51, 51, 50, 18, 102,
790 62, 104, 52, 167, 51, 67, 56, 27, 96, 87, 790 62, 104, 52, 87, 167, 67, 56, 27, 96, 72,
791 51, 31, 33, 37, 47, 82, 37, 41, 33, 37, 791 47, 31, 33, 37, 37, 82, 37, 41, 33, 37,
792 41, 33, 125, 47, 48, 55, 47, 48, 49, 47, 792 41, 124, 47, 47, 48, 55, 47, 48, 49, 47,
793 48, 33, 47, 47, 102, 47, 104, 140, 44, 45, 793 48, 33, 47, 37, 44, 45, 139, 41, 33, 44,
794 44, 37, 72, 51, 37, 47, 149, 150, 41, 37, 794 45, 44, 72, 47, 48, 47, 149, 150, 52, 137,
795 138, 47, 48, 41, 47, 48, 149, 150, 125, 47, 795 37, 51, 47, 37, 41, 37, 44, 124, 49, 41,
796 48, 44, 45, 37, 44, 46, 45, 155, 1, 31, 796 47, 48, 45, 47, 48, 47, 48, 155, 1, 149,
797 52, 49, 5, 6, 7, 8, 9, 10, 11, 167, 797 150, 46, 5, 6, 7, 8, 9, 10, 11, 167,
798 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 798 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
799 49, 24, 25, 26, 27, 28, 49, 34, 31, 44, 799 49, 24, 25, 26, 27, 28, 49, 52, 31, 34,
800 46, 44, 30, 44, 37, 49, 36, 49, 41, 34, 800 44, 46, 44, 30, 37, 44, 49, 36, 41, 49,
801 50, 44, 45, 49, 47, 48, 1, 46, 49, 52, 801 31, 44, 45, 49, 47, 48, 1, 49, 46, 52,
802 5, 6, 7, 8, 9, 10, 11, 49, 13, 14, 802 5, 6, 7, 8, 9, 10, 11, 49, 13, 14,
803 15, 16, 17, 18, 19, 20, 21, 22, 49, 24, 803 15, 16, 17, 18, 19, 20, 21, 22, 34, 24,
804 25, 26, 27, 28, 49, 49, 31, 49, 49, 49, 804 25, 26, 27, 28, 49, 49, 31, 49, 49, 49,
805 1, 90, 37, 77, 155, 140, 41, 105, -1, 44, 805 49, 1, 37, 90, 155, 105, 41, 77, 139, 44,
806 45, -1, 47, 48, 1, 100, -1, 52, 5, 6, 806 45, -1, 47, 48, 1, -1, 100, 52, 5, 6,
807 7, 8, 9, 10, 11, -1, 13, 14, 15, 16, 807 7, 8, 9, 10, 11, -1, 13, 14, 15, 16,
808 17, 18, 19, 20, 21, 22, -1, 24, 25, 26, 808 17, 18, 19, 20, 21, 22, -1, 24, 25, 26,
809 27, 28, -1, -1, 31, -1, -1, -1, -1, 36, 809 27, 28, -1, -1, 31, -1, -1, -1, -1, 36,
@@ -855,9 +855,9 @@ static const yytype_uint8 yystos[] =
855 46, 74, 30, 32, 97, 33, 47, 60, 44, 45, 855 46, 74, 30, 32, 97, 33, 47, 60, 44, 45,
856 37, 41, 47, 52, 70, 76, 77, 91, 92, 93, 856 37, 41, 47, 52, 70, 76, 77, 91, 92, 93,
857 94, 45, 1, 90, 74, 48, 49, 49, 49, 49, 857 94, 45, 1, 90, 74, 48, 49, 49, 49, 49,
858 73, 63, 31, 95, 1, 65, 78, 79, 80, 81, 858 73, 63, 95, 1, 65, 78, 79, 80, 81, 94,
859 94, 1, 37, 76, 34, 76, 95, 33, 47, 44, 859 1, 37, 76, 34, 76, 95, 33, 47, 44, 46,
860 46, 49, 44, 50, 85, 86, 49, 37, 41, 47, 860 49, 44, 31, 50, 85, 86, 49, 37, 41, 47,
861 70, 82, 83, 49, 36, 46, 49, 49, 1, 78, 861 70, 82, 83, 49, 36, 46, 49, 49, 1, 78,
862 93, 34, 1, 41, 82, 82, 33, 47, 36, 81, 862 93, 34, 1, 41, 82, 82, 33, 47, 36, 81,
863 49, 49, 49, 49, 1, 78, 49, 49 863 49, 49, 49, 49, 1, 78, 49, 49
diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y
index 408cdf82b271..10d7dc724b6d 100644
--- a/scripts/genksyms/parse.y
+++ b/scripts/genksyms/parse.y
@@ -446,7 +446,7 @@ member_bitfield_declarator:
446 446
447attribute_opt: 447attribute_opt:
448 /* empty */ { $$ = NULL; } 448 /* empty */ { $$ = NULL; }
449 | ATTRIBUTE_PHRASE 449 | attribute_opt ATTRIBUTE_PHRASE
450 ; 450 ;
451 451
452asm_definition: 452asm_definition: