aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJan Beulich <JBeulich@suse.com>2014-04-03 17:46:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-03 19:20:52 -0400
commitdc53324060f324e8af6867f57bf4891c13c6ef18 (patch)
tree8cad63d6b8b31d945dae80f0c18f1c2cb4ad0949 /scripts
parentd507816b58bebc8f9c1bed6a28affaf0729306e2 (diff)
genksyms: fix typeof() handling
Recent increased use of typeof() throughout the tree resulted in a number of symbols (25 in a typical distro config of ours) not getting a proper CRC calculated for them anymore, due to the parser in genksyms not coping with several of these uses (interestingly in the majority of [if not all] cases the problem is due to the use of typeof() in code preceding a certain export, not in the declaration/definition of the exported function/object itself; I wasn't able to find a way to address this more general parser shortcoming). The use of parameter_declaration is a little more relaxed than would be ideal (permitting not just a bare type specification, but also one with identifier), but since the same code is being passed through an actual compiler, there's no apparent risk of allowing through any broken code. Otoh using parameter_declaration instead of the ad hoc "decl_specifier_seq '*'" / "decl_specifier_seq" pair allows all types to be handled rather than just plain ones and pointers to plain ones. Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: Michal Marek <mmarek@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genksyms/keywords.gperf5
-rw-r--r--scripts/genksyms/keywords.hash.c_shipped133
-rw-r--r--scripts/genksyms/lex.l51
-rw-r--r--scripts/genksyms/lex.lex.c_shipped51
-rw-r--r--scripts/genksyms/parse.tab.c_shipped608
-rw-r--r--scripts/genksyms/parse.tab.h_shipped29
-rw-r--r--scripts/genksyms/parse.y5
7 files changed, 498 insertions, 384 deletions
diff --git a/scripts/genksyms/keywords.gperf b/scripts/genksyms/keywords.gperf
index 3e77a943e7b7..a9096d993172 100644
--- a/scripts/genksyms/keywords.gperf
+++ b/scripts/genksyms/keywords.gperf
@@ -23,6 +23,8 @@ __inline, INLINE_KEYW
23__inline__, INLINE_KEYW 23__inline__, INLINE_KEYW
24__signed, SIGNED_KEYW 24__signed, SIGNED_KEYW
25__signed__, SIGNED_KEYW 25__signed__, SIGNED_KEYW
26__typeof, TYPEOF_KEYW
27__typeof__, TYPEOF_KEYW
26__volatile, VOLATILE_KEYW 28__volatile, VOLATILE_KEYW
27__volatile__, VOLATILE_KEYW 29__volatile__, VOLATILE_KEYW
28# According to rth, c99 defines _Bool, __restrict, __restrict__, restrict. KAO 30# According to rth, c99 defines _Bool, __restrict, __restrict__, restrict. KAO
@@ -51,9 +53,8 @@ signed, SIGNED_KEYW
51static, STATIC_KEYW 53static, STATIC_KEYW
52struct, STRUCT_KEYW 54struct, STRUCT_KEYW
53typedef, TYPEDEF_KEYW 55typedef, TYPEDEF_KEYW
56typeof, TYPEOF_KEYW
54union, UNION_KEYW 57union, UNION_KEYW
55unsigned, UNSIGNED_KEYW 58unsigned, UNSIGNED_KEYW
56void, VOID_KEYW 59void, VOID_KEYW
57volatile, VOLATILE_KEYW 60volatile, VOLATILE_KEYW
58typeof, TYPEOF_KEYW
59__typeof__, TYPEOF_KEYW
diff --git a/scripts/genksyms/keywords.hash.c_shipped b/scripts/genksyms/keywords.hash.c_shipped
index 82062607e8c0..e9452482e198 100644
--- a/scripts/genksyms/keywords.hash.c_shipped
+++ b/scripts/genksyms/keywords.hash.c_shipped
@@ -34,7 +34,7 @@ struct resword;
34static const struct resword *is_reserved_word(register const char *str, register unsigned int len); 34static const struct resword *is_reserved_word(register const char *str, register unsigned int len);
35#line 8 "scripts/genksyms/keywords.gperf" 35#line 8 "scripts/genksyms/keywords.gperf"
36struct resword { const char *name; int token; }; 36struct resword { const char *name; int token; };
37/* maximum key range = 64, duplicates = 0 */ 37/* maximum key range = 98, duplicates = 0 */
38 38
39#ifdef __GNUC__ 39#ifdef __GNUC__
40__inline 40__inline
@@ -48,32 +48,32 @@ is_reserved_hash (register const char *str, register unsigned int len)
48{ 48{
49 static const unsigned char asso_values[] = 49 static const unsigned char asso_values[] =
50 { 50 {
51 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 51 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
52 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 52 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
53 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 53 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
54 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 54 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
55 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 55 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
56 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 56 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
57 67, 67, 67, 67, 67, 67, 67, 67, 67, 0, 57 101, 101, 101, 101, 101, 101, 101, 101, 101, 0,
58 67, 67, 67, 67, 67, 67, 15, 67, 67, 67, 58 101, 101, 101, 101, 101, 101, 15, 101, 101, 101,
59 0, 67, 67, 67, 67, 67, 67, 67, 67, 67, 59 0, 101, 101, 101, 101, 101, 101, 101, 101, 101,
60 67, 67, 67, 67, 67, 0, 67, 0, 67, 5, 60 101, 101, 101, 101, 101, 0, 101, 0, 101, 5,
61 25, 20, 15, 30, 67, 15, 67, 67, 10, 0, 61 25, 20, 55, 30, 101, 15, 101, 101, 10, 0,
62 10, 40, 20, 67, 10, 5, 0, 10, 15, 67, 62 10, 40, 10, 101, 10, 5, 0, 10, 15, 101,
63 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 63 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
64 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 64 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
65 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 65 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
66 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 66 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
67 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
68 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
69 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 69 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
70 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 70 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
71 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 71 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
72 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 72 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
73 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 73 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
74 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 74 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
75 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 75 101, 101, 101, 101, 101, 101, 101, 101, 101, 101,
76 67, 67, 67, 67, 67, 67 76 101, 101, 101, 101, 101, 101
77 }; 77 };
78 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; 78 return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
79} 79}
@@ -89,17 +89,17 @@ is_reserved_word (register const char *str, register unsigned int len)
89{ 89{
90 enum 90 enum
91 { 91 {
92 TOTAL_KEYWORDS = 45, 92 TOTAL_KEYWORDS = 46,
93 MIN_WORD_LENGTH = 3, 93 MIN_WORD_LENGTH = 3,
94 MAX_WORD_LENGTH = 24, 94 MAX_WORD_LENGTH = 24,
95 MIN_HASH_VALUE = 3, 95 MIN_HASH_VALUE = 3,
96 MAX_HASH_VALUE = 66 96 MAX_HASH_VALUE = 100
97 }; 97 };
98 98
99 static const struct resword wordlist[] = 99 static const struct resword wordlist[] =
100 { 100 {
101 {""}, {""}, {""}, 101 {""}, {""}, {""},
102#line 33 "scripts/genksyms/keywords.gperf" 102#line 35 "scripts/genksyms/keywords.gperf"
103 {"asm", ASM_KEYW}, 103 {"asm", ASM_KEYW},
104 {""}, 104 {""},
105#line 15 "scripts/genksyms/keywords.gperf" 105#line 15 "scripts/genksyms/keywords.gperf"
@@ -108,7 +108,7 @@ is_reserved_word (register const char *str, register unsigned int len)
108#line 16 "scripts/genksyms/keywords.gperf" 108#line 16 "scripts/genksyms/keywords.gperf"
109 {"__asm__", ASM_KEYW}, 109 {"__asm__", ASM_KEYW},
110 {""}, {""}, 110 {""}, {""},
111#line 59 "scripts/genksyms/keywords.gperf" 111#line 27 "scripts/genksyms/keywords.gperf"
112 {"__typeof__", TYPEOF_KEYW}, 112 {"__typeof__",