Commit 57146c8a authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: [PATCH] adapt genksyms for current kbuild

By Rusty Russell.

o generate output in a form feasible as linker script instead of 
  munging it with sed during the build
o remove checksum version 1 support
o remove prefix support
parent 46bd1da6
...@@ -150,13 +150,7 @@ void *__symbol_get(const char *symbol); ...@@ -150,13 +150,7 @@ void *__symbol_get(const char *symbol);
void *__symbol_get_gpl(const char *symbol); void *__symbol_get_gpl(const char *symbol);
#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) #define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x)))
#ifdef __GENKSYMS__ #ifndef __GENKSYMS__
/* genksyms doesn't handle GPL-only symbols yet */
#define EXPORT_SYMBOL_GPL EXPORT_SYMBOL
#else
#ifdef CONFIG_MODVERSIONS #ifdef CONFIG_MODVERSIONS
/* Mark the CRC weak since genksyms apparently decides not to /* Mark the CRC weak since genksyms apparently decides not to
* generate a checksums for some symbols */ * generate a checksums for some symbols */
...@@ -188,7 +182,7 @@ void *__symbol_get_gpl(const char *symbol); ...@@ -188,7 +182,7 @@ void *__symbol_get_gpl(const char *symbol);
#endif #endif
/* We don't mangle the actual symbol anymore, so no need for /* We don't mangle the actual symbol anymore, so no need for
* special casing EXPORT_SYMBOL_NOVERS */ * special casing EXPORT_SYMBOL_NOVERS. FIXME: Deprecated */
#define EXPORT_SYMBOL_NOVERS(sym) EXPORT_SYMBOL(sym) #define EXPORT_SYMBOL_NOVERS(sym) EXPORT_SYMBOL(sym)
struct module_ref struct module_ref
......
...@@ -90,8 +90,7 @@ define rule_vcc_o_c ...@@ -90,8 +90,7 @@ define rule_vcc_o_c
mv $(@D)/.tmp_$(@F) $@; \ mv $(@D)/.tmp_$(@F) $@; \
else \ else \
$(CPP) -D__GENKSYMS__ $(c_flags) $< \ $(CPP) -D__GENKSYMS__ $(c_flags) $< \
| $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \ | $(GENKSYMS) \
| sed -n 's/\#define __ver_\([^ ]*\)[ ]*\([^ ]*\)/__crc_\1 = 0x\2 ;/gp' \
> $(@D)/.tmp_$(@F:.o=.ver); \ > $(@D)/.tmp_$(@F:.o=.ver); \
\ \
$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \ $(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) \
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
New implementation contributed by Richard Henderson <rth@tamu.edu> New implementation contributed by Richard Henderson <rth@tamu.edu>
Based on original work by Bjorn Ekwall <bj0rn@blox.se> Based on original work by Bjorn Ekwall <bj0rn@blox.se>
This file is part of the Linux modutils. This file was part of the Linux modutils 2.4.22: moved back into the
kernel sources by Rusty Russell/Kai Germaschewski.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -32,22 +33,20 @@ ...@@ -32,22 +33,20 @@
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#define HASH_BUCKETS 4099 #define HASH_BUCKETS 4096
static struct symbol *symtab[HASH_BUCKETS]; static struct symbol *symtab[HASH_BUCKETS];
FILE *outfile, *debugfile; FILE *debugfile;
int cur_line = 1; int cur_line = 1;
char *cur_filename, *output_directory; char *cur_filename, *output_directory;
int flag_debug, flag_dump_defs, flag_warnings; int flag_debug, flag_dump_defs, flag_warnings;
int checksum_version = 1, kernel_version = version(2,0,0);
static int errors; static int errors;
static int nsyms; static int nsyms;
static struct symbol *expansion_trail; static struct symbol *expansion_trail;
static const char *crc_prefix = "";
static const char * const symbol_type_name[] = { static const char * const symbol_type_name[] = {
"normal", "typedef", "enum", "struct", "union" "normal", "typedef", "enum", "struct", "union"
...@@ -355,9 +354,7 @@ expand_and_crc_list(struct string_list *list, unsigned long crc) ...@@ -355,9 +354,7 @@ expand_and_crc_list(struct string_list *list, unsigned long crc)
case SYM_TYPEDEF: case SYM_TYPEDEF:
subsym = find_symbol(cur->string, cur->tag); subsym = find_symbol(cur->string, cur->tag);
if (checksum_version == 1) if (subsym->expansion_trail)
crc = expand_and_crc_list(subsym->defn, crc);
else if (subsym->expansion_trail)
{ {
if (flag_dump_defs) if (flag_dump_defs)
fprintf(debugfile, "%s ", cur->string); fprintf(debugfile, "%s ", cur->string);
...@@ -458,43 +455,13 @@ export_symbol(const char *name) ...@@ -458,43 +455,13 @@ export_symbol(const char *name)
if (flag_dump_defs) if (flag_dump_defs)
fputs(">\n", debugfile); fputs(">\n", debugfile);
if (checksum_version > 1) /* Used as a linker script. */
{ printf("__crc_%s = 0x%08lx ;\n", name, crc);
fprintf(outfile, "#define __ver_%s\t%s%08lx\n", name,
crc_prefix, crc);
fprintf(outfile, "#define %s\t_set_ver(%s)\n", name, name);
}
else
{
fprintf(outfile, "#define %s\t_set_ver(%s, %s%08lx)\n", name, name,
crc_prefix, crc);
}
} }
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
static int
parse_kernel_version(char * p)
{
int a, b, c;
a = strtoul(p, &p, 10);
if (*p != '.')
return -1;
b = strtoul(p+1, &p, 10);
if (*p != '.')
return -1;
c = strtoul(p+1, &p, 10);
if (*p != '\0')
return -1;
kernel_version = a << 16 | b << 8 | c;
return 0;
}
void void
error(const char *fmt, ...) error(const char *fmt, ...)
{ {
...@@ -533,7 +500,7 @@ error_with_pos(const char *fmt, ...) ...@@ -533,7 +500,7 @@ error_with_pos(const char *fmt, ...)
void genksyms_usage(void) void genksyms_usage(void)
{ {
fputs("Usage:\n" fputs("Usage:\n"
"genksyms [-dDwqhV] [-k kernel_version] [-p prefix] > .../linux/module/*.ver\n" "genksyms [-dDwqhV] > /path/to/.tmp_obj.ver\n"
"\n" "\n"
" -d, --debug Increment the debug level (repeatable)\n" " -d, --debug Increment the debug level (repeatable)\n"
" -D, --dump Dump expanded symbol defs (for debugging only)\n" " -D, --dump Dump expanded symbol defs (for debugging only)\n"
...@@ -541,10 +508,6 @@ void genksyms_usage(void) ...@@ -541,10 +508,6 @@ void genksyms_usage(void)
" -q, --quiet Disable warnings (default)\n" " -q, --quiet Disable warnings (default)\n"
" -h, --help Print this message\n" " -h, --help Print this message\n"
" -V, --version Print the release version\n" " -V, --version Print the release version\n"
" -k ver\n"
" --kernel ver Set the kernel version for which we are compiling\n"
" -p string\n"
" --prefix string Set a mangling prefix for all symbols\n"
, stderr); , stderr);
} }
...@@ -558,8 +521,6 @@ main(int argc, char **argv) ...@@ -558,8 +521,6 @@ main(int argc, char **argv)
{"warnings", 0, 0, 'w'}, {"warnings", 0, 0, 'w'},
{"quiet", 0, 0, 'q'}, {"quiet", 0, 0, 'q'},
{"dump", 0, 0, 'D'}, {"dump", 0, 0, 'D'},
{"kernel", 1, 0, 'k'},
{"prefix", 1, 0, 'p'},
{"version", 0, 0, 'V'}, {"version", 0, 0, 'V'},
{"help", 0, 0, 'h'}, {"help", 0, 0, 'h'},
{0, 0, 0, 0} {0, 0, 0, 0}
...@@ -579,20 +540,11 @@ main(int argc, char **argv) ...@@ -579,20 +540,11 @@ main(int argc, char **argv)
flag_warnings = 0; flag_warnings = 0;
break; break;
case 'V': case 'V':
fputs("genksyms version " MODUTILS_VERSION "\n", stderr); fputs("genksyms version 2.5.60\n", stderr);
break; break;
case 'D': case 'D':
flag_dump_defs = 1; flag_dump_defs = 1;
break; break;
case 'k':
if (parse_kernel_version(optarg)) {
fprintf( stderr, "unrecognised kernel version : %s\n", optarg);
return -1;
}
break;
case 'p':
crc_prefix = optarg;
break;
case 'h': case 'h':
genksyms_usage(); genksyms_usage();
return 0; return 0;
...@@ -601,27 +553,6 @@ main(int argc, char **argv) ...@@ -601,27 +553,6 @@ main(int argc, char **argv)
return 1; return 1;
} }
if (kernel_version >= version(2,1,18))
{
if (optind != argc) {
genksyms_usage();
return 1;
}
/* For newer kernels, eliminate some irrelevant constructs. */
checksum_version = 2;
outfile = stdout;
}
else
{
if (optind+1 != argc) {
genksyms_usage();
return 1;
}
output_directory = argv[optind];
}
{ {
extern int yydebug; extern int yydebug;
extern int yy_flex_debug; extern int yy_flex_debug;
...@@ -635,11 +566,6 @@ main(int argc, char **argv) ...@@ -635,11 +566,6 @@ main(int argc, char **argv)
yyparse(); yyparse();
if (checksum_version == 1)
{
fputs("#endif\n#endif\n", outfile);
}
if (flag_debug) if (flag_debug)
{ {
fprintf(debugfile, "Hash table occupancy %d/%d = %g\n", fprintf(debugfile, "Hash table occupancy %d/%d = %g\n",
......
...@@ -454,7 +454,7 @@ int yy_flex_debug = 1; ...@@ -454,7 +454,7 @@ int yy_flex_debug = 1;
static yyconst short int yy_rule_linenum[13] = static yyconst short int yy_rule_linenum[13] =
{ 0, { 0,
69, 70, 71, 74, 77, 78, 79, 85, 86, 87, 69, 70, 71, 74, 77, 78, 79, 85, 86, 87,
92, 95 89, 92
} ; } ;
/* The intent behind this definition is that it'll catch /* The intent behind this definition is that it'll catch
...@@ -473,7 +473,7 @@ char *yytext; ...@@ -473,7 +473,7 @@ char *yytext;
New implementation contributed by Richard Henderson <rth@tamu.edu> New implementation contributed by Richard Henderson <rth@tamu.edu>
Based on original work by Bjorn Ekwall <bj0rn@blox.se> Based on original work by Bjorn Ekwall <bj0rn@blox.se>
This file is part of the Linux modutils. Taken from Linux modutils 2.4.22.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -820,26 +820,23 @@ YY_RULE_SETUP ...@@ -820,26 +820,23 @@ YY_RULE_SETUP
#line 87 "scripts/genksyms/lex.l" #line 87 "scripts/genksyms/lex.l"
return REAL; return REAL;
YY_BREAK YY_BREAK
/* Version 1 checksums didn't recognize ellipsis as a token, but we
need it for proper parsing. We'll take care of backward compatibility
by altering the text of the token in the second stage lexer. */
case 11: case 11:
YY_RULE_SETUP YY_RULE_SETUP
#line 92 "scripts/genksyms/lex.l" #line 89 "scripts/genksyms/lex.l"
return DOTS; return DOTS;
YY_BREAK YY_BREAK
/* All other tokens are single characters. */ /* All other tokens are single characters. */
case 12: case 12:
YY_RULE_SETUP YY_RULE_SETUP
#line 95 "scripts/genksyms/lex.l" #line 92 "scripts/genksyms/lex.l"
return yytext[0]; return yytext[0];
YY_BREAK YY_BREAK
case 13: case 13:
YY_RULE_SETUP YY_RULE_SETUP
#line 98 "scripts/genksyms/lex.l" #line 95 "scripts/genksyms/lex.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 843 "scripts/genksyms/lex.c" #line 840 "scripts/genksyms/lex.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(V2_TOKENS): case YY_STATE_EOF(V2_TOKENS):
yyterminate(); yyterminate();
...@@ -1723,7 +1720,7 @@ int main() ...@@ -1723,7 +1720,7 @@ int main()
return 0; return 0;
} }
#endif #endif
#line 98 "scripts/genksyms/lex.l" #line 95 "scripts/genksyms/lex.l"
/* Bring in the keyword recognizer. */ /* Bring in the keyword recognizer. */
...@@ -1764,8 +1761,7 @@ yylex(void) ...@@ -1764,8 +1761,7 @@ yylex(void)
if (lexstate == ST_NOTSTARTED) if (lexstate == ST_NOTSTARTED)
{ {
if (checksum_version > 1) BEGIN(V2_TOKENS);
BEGIN(V2_TOKENS);
next_node = xmalloc(sizeof(*next_node)); next_node = xmalloc(sizeof(*next_node));
next_node->next = NULL; next_node->next = NULL;
lexstate = ST_NORMAL; lexstate = ST_NORMAL;
...@@ -1791,93 +1787,6 @@ repeat: ...@@ -1791,93 +1787,6 @@ repeat:
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_line = atoi(yytext+2); cur_line = atoi(yytext+2);
/* Linux kernels 2.1.18 and above (roughly) get to ignore the
hackery below. */
if (checksum_version == 1)
{
static const char symtab_begin[] = "linux/symtab_begin.h";
static const char symtab_end[] = "linux/symtab_end.h";
/* When building 2.0 kernels, we are only given the output directory
and we're supposed to deduce the output filename from the cpp
output. */
if (outfile == NULL)
{
char buffer[PATH_MAX], *dot, *p, *q, *f;
dot = strrchr(file, '.');
f = strrchr(file, '/');
if (dot) *dot = '\0';
f = (f ? f+1 : file);
snprintf(buffer, sizeof(buffer), "%s/%s.ver", output_directory, f);
if ((outfile = fopen(buffer, "w")) == NULL)
{
perror(buffer);
exit(1);
}
fputs("/* This file is generated by genksyms DO NOT EDIT! */\n"
"#if (defined(CONFIG_MODVERSIONS) || defined(MODVERSIONS))"
" && !defined(__GENKSYMS__)\n", outfile);
q = buffer;
*q++ = '_';
for (p = f; *p ; ++p, ++q)
*q = (*p == '.' ? '_' : toupper(*p));
memcpy(q, "_VER_", 6);
fprintf(outfile, "#ifndef %s\n", buffer);
fprintf(outfile, "#define %s\n", buffer);
if (dot) *dot = '.';
}
/* For 2.0 kernels, symbol tables are constructed in big initialized
arrays that begin by including <linux/symtab_begin.h> and end by
including <linux/symtab_end.h>. We're going to transmute this
little bit o' nastiness into something that, from the perspective
of the grammar, resembles the 2.1 scheme in the following
fashion:
When we see a file name with a suffix matching symtab_begin we
should be in ST_EXPRESSION, having already seen the "= {" bits.
We get the grammar back to top-level in two stages, by returning
EXPRESSION_PHRASE then ';' as we move through ST_TABLE_1 to
ST_TABLE_2 eating the tokens we find that were contained in
symtab_begin.h. The body of the work is done in ST_TABLE_{2,5,6}
by transmuting X to EXPORT_SYMBOL and ',' to ';'. We return
to normal mode when we see a file name with a suffix matching
symtab_end.h.
This is not particularly pretty, but it is better than either
truely parsing expressions or some other bit o hackery to always
recognize and record "X" tokens for later perusal. */
if (e-file > sizeof(symtab_begin)
&& strcmp(e-sizeof(symtab_begin)+1, symtab_begin) == 0)
{
if (lexstate != ST_TABLE_1)
{
lexstate = ST_TABLE_1;
return EXPRESSION_PHRASE;
}
}
else if (e-file > sizeof(symtab_end)
&& strcmp(e-sizeof(symtab_end)+1, symtab_end) == 0)
lexstate = ST_TABLE_3;
else if (lexstate == ST_TABLE_1)
{
lexstate = ST_TABLE_2;
return ';';
}
else if (lexstate == ST_TABLE_3)
lexstate = ST_TABLE_4;
}
goto repeat; goto repeat;
} }
...@@ -1911,10 +1820,7 @@ repeat: ...@@ -1911,10 +1820,7 @@ repeat:
goto fini; goto fini;
case EXPORT_SYMBOL_KEYW: case EXPORT_SYMBOL_KEYW:
if (checksum_version > 1)
goto fini; goto fini;
else
token = IDENT;
} }
} }
if (!suppress_type_lookup) if (!suppress_type_lookup)
...@@ -1946,11 +1852,6 @@ repeat: ...@@ -1946,11 +1852,6 @@ repeat:
break; break;
case DOTS: case DOTS:
if (checksum_version == 1)
{
_APP(". . .", 5);
break;
}
default: default:
APP; APP;
break; break;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
New implementation contributed by Richard Henderson <rth@tamu.edu> New implementation contributed by Richard Henderson <rth@tamu.edu>
Based on original work by Bjorn Ekwall <bj0rn@blox.se> Based on original work by Bjorn Ekwall <bj0rn@blox.se>
This file is part of the Linux modutils. Taken from Linux modutils 2.4.22.
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the under the terms of the GNU General Public License as published by the
...@@ -86,9 +86,6 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) ...@@ -86,9 +86,6 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
<V2_TOKENS>{INT} return INT; <V2_TOKENS>{INT} return INT;
<V2_TOKENS>{REAL} return REAL; <V2_TOKENS>{REAL} return REAL;
/* Version 1 checksums didn't recognize ellipsis as a token, but we
need it for proper parsing. We'll take care of backward compatibility
by altering the text of the token in the second stage lexer. */
"..." return DOTS; "..." return DOTS;
/* All other tokens are single characters. */ /* All other tokens are single characters. */
...@@ -135,8 +132,7 @@ yylex(void) ...@@ -135,8 +132,7 @@ yylex(void)
if (lexstate == ST_NOTSTARTED) if (lexstate == ST_NOTSTARTED)
{ {
if (checksum_version > 1) BEGIN(V2_TOKENS);
BEGIN(V2_TOKENS);
next_node = xmalloc(sizeof(*next_node)); next_node = xmalloc(sizeof(*next_node));
next_node->next = NULL; next_node->next = NULL;
lexstate = ST_NORMAL; lexstate = ST_NORMAL;
...@@ -162,93 +158,6 @@ repeat: ...@@ -162,93 +158,6 @@ repeat:
cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1); cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
cur_line = atoi(yytext+2); cur_line = atoi(yytext+2);
/* Linux kernels 2.1.18 and above (roughly) get to ignore the
hackery below. */
if (checksum_version == 1)
{
static const char symtab_begin[] = "linux/symtab_begin.h";
static const char symtab_end[] = "linux/symtab_end.h";
/* When building 2.0 kernels, we are only given the output directory
and we're supposed to deduce the output filename from the cpp
output. */
if (outfile == NULL)
{
char buffer[PATH_MAX], *dot, *p, *q, *f;
dot = strrchr(file, '.');
f = strrchr(file, '/');
if (dot) *dot = '\0';
f = (f ? f+1 : file);
snprintf(buffer, sizeof(buffer), "%s/%s.ver", output_directory, f);
if ((outfile = fopen(buffer, "w")) == NULL)
{
perror(buffer);
exit(1);
}
fputs("/* This file is generated by genksyms DO NOT EDIT! */\n"
"#if (defined(CONFIG_MODVERSIONS) || defined(MODVERSIONS))"
" && !defined(__GENKSYMS__)\n", outfile);
q = buffer;
*q++ = '_';
for (p = f; *p ; ++p, ++q)
*q = (*p == '.' ? '_' : toupper(*p));
memcpy(q, "_VER_", 6);
fprintf(outfile, "#ifndef %s\n", buffer);
fprintf(outfile, "#define %s\n", buffer);
if (dot) *dot = '.';
}
/* For 2.0 kernels, symbol tables are constructed in big initialized
arrays that begin by including <linux/symtab_begin.h> and end by
including <linux/symtab_end.h>. We're going to transmute this
little bit o' nastiness into something that, from the perspective
of the grammar, resembles the 2.1 scheme in the following
fashion:
When we see a file name with a suffix matching symtab_begin we
should be in ST_EXPRESSION, having already seen the "= {" bits.
We get the grammar back to top-level in two stages, by returning
EXPRESSION_PHRASE then ';' as we move through ST_TABLE_1 to
ST_TABLE_2 eating the tokens we find that were contained in
symtab_begin.h. The body of the work is done in ST_TABLE_{2,5,6}
by transmuting X to EXPORT_SYMBOL and ',' to ';'. We return
to normal mode when we see a file name with a suffix matching
symtab_end.h.
This is not particularly pretty, but it is better than either
truely parsing expressions or some other bit o hackery to always
recognize and record "X" tokens for later perusal. */
if (e-file > sizeof(symtab_begin)
&& strcmp(e-sizeof(symtab_begin)+1, symtab_begin) == 0)
{
if (lexstate != ST_TABLE_1)
{
lexstate = ST_TABLE_1;
return EXPRESSION_PHRASE;
}
}
else if (e-file > sizeof(symtab_end)
&& strcmp(e-sizeof(symtab_end)+1, symtab_end) == 0)
lexstate = ST_TABLE_3;
else if (lexstate == ST_TABLE_1)
{
lexstate = ST_TABLE_2;
return ';';
}
else if (lexstate == ST_TABLE_3)
lexstate = ST_TABLE_4;
}
goto repeat; goto repeat;
} }
...@@ -282,10 +191,7 @@ repeat: ...@@ -282,10 +191,7 @@ repeat:
goto fini; goto fini;
case EXPORT_SYMBOL_KEYW: case EXPORT_SYMBOL_KEYW:
if (checksum_version > 1)
goto fini; goto fini;
else
token = IDENT;
} }
} }
if (!suppress_type_lookup) if (!suppress_type_lookup)
...@@ -317,11 +223,6 @@ repeat: ...@@ -317,11 +223,6 @@ repeat:
break; break;
case DOTS: case DOTS:
if (checksum_version == 1)
{
_APP(". . .", 5);
break;
}
default: default:
APP; APP;
break; break;
......
...@@ -188,17 +188,17 @@ static const short yyrhs[] = { 52, ...@@ -188,17 +188,17 @@ static const short yyrhs[] = { 52,
static const short yyrline[] = { 0, static const short yyrline[] = { 0,
100, 102, 105, 108, 111, 113, 114, 115, 116, 117, 100, 102, 105, 108, 111, 113, 114, 115, 116, 117,
118, 119, 122, 136, 138, 141, 150, 162, 168, 170, 118, 119, 122, 136, 138, 141, 150, 162, 168, 170,
173, 175, 178, 186, 189, 191, 192, 193, 194, 197, 173, 175, 178, 185, 188, 190, 191, 192, 193, 196,
199, 203, 205, 207, 211, 218, 225, 234, 235, 236, 198, 202, 204, 206, 210, 217, 224, 233, 234, 235,
239, 241, 242, 243, 244, 245, 246, 247, 248, 249, 238, 240, 241, 242, 243, 244, 245, 246, 247, 248,
250, 253, 258, 260, 263, 265, 268, 269, 269, 270, 249, 252, 257, 259, 262, 264, 267, 268, 268, 269,
277, 279, 282, 292, 294, 296, 298, 300, 306, 308, 276, 278, 281, 291, 293, 295, 297, 299, 305, 307,
311, 313, 314, 316, 318, 320, 322, 326, 328, 329, 310, 312, 313, 315, 317, 319, 321, 325, 327, 328,
332, 334, 337, 339, 343, 348, 351, 354, 356, 365, 331, 333, 336, 338, 342, 347, 350, 353, 355, 363,
370, 372, 374, 376, 378, 382, 391, 393, 397, 402, 367, 369, 371, 373, 375, 379, 388, 390, 394, 399,
404, 407, 409, 412, 414, 417, 420, 424, 426, 429, 401, 404, 406, 409, 411, 414, 417, 421, 423, 426,
431, 434, 436, 437, 440, 444, 446, 449, 453, 455, 428, 431, 433, 434, 437, 441, 443, 446, 450, 452,
458 455
}; };
#endif #endif
...@@ -1042,33 +1042,32 @@ case 23: ...@@ -1042,33 +1042,32 @@ case 23:
#line 180 "scripts/genksyms/parse.y" #line 180 "scripts/genksyms/parse.y"
{ /* Version 2 checksumming ignores storage class, as that { /* Version 2 checksumming ignores storage class, as that
is really irrelevant to the linkage. */ is really irrelevant to the linkage. */
if (checksum_version > 1) remove_node(yyvsp[0]);
remove_node(yyvsp[0]);
yyval = yyvsp[0]; yyval = yyvsp[0];
; ;
break;} break;}
case 28: case 28:
#line 193 "scripts/genksyms/parse.y" #line 192 "scripts/genksyms/parse.y"
{ is_extern = 1; yyval = yyvsp[0]; ; { is_extern = 1; yyval = yyvsp[0]; ;
break;} break;}
case 29: case 29:
#line 194 "scripts/genksyms/parse.y" #line 193 "scripts/genksyms/parse.y"
{ is_extern = 0; yyval = yyvsp[0]; ; { is_extern = 0; yyval = yyvsp[0]; ;
break;} break;}
case 32: case 32:
#line 204 "scripts/genksyms/parse.y" #line 203 "scripts/genksyms/parse.y"
{ remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ; { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ;
break;} break;}
case 33: case 33:
#line 206 "scripts/genksyms/parse.y" #line 205 "scripts/genksyms/parse.y"
{ remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ; { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ;
break;} break;}
case 34: case 34:
#line 208 "scripts/genksyms/parse.y" #line 207 "scripts/genksyms/parse.y"
{ remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ; { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ;
break;} break;}
case 35: case 35:
#line 212 "scripts/genksyms/parse.y" #line 211 "scripts/genksyms/parse.y"
{ struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r; { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
r = copy_node(i); r->tag = SYM_STRUCT; r = copy_node(i); r->tag = SYM_STRUCT;
r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL; r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
...@@ -1077,7 +1076,7 @@ case 35: ...@@ -1077,7 +1076,7 @@ case 35:
; ;
break;} break;}
case 36: case 36:
#line 219 "scripts/genksyms/parse.y" #line 218 "scripts/genksyms/parse.y"
{ struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r; { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
r = copy_node(i); r->tag = SYM_UNION; r = copy_node(i); r->tag = SYM_UNION;
r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL; r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
...@@ -1086,7 +1085,7 @@ case 36: ...@@ -1086,7 +1085,7 @@ case 36:
; ;
break;} break;}
case 37: case 37:
#line 226 "scripts/genksyms/parse.y" #line 225 "scripts/genksyms/parse.y"
{ struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r; { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
r = copy_node(i); r->tag = SYM_ENUM; r = copy_node(i); r->tag = SYM_ENUM;
r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL; r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
...@@ -1095,46 +1094,46 @@ case 37: ...@@ -1095,46 +1094,46 @@ case 37:
; ;
break;} break;}
case 38: case 38:
#line 234 "scripts/genksyms/parse.y" #line 233 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 39: case 39:
#line 235 "scripts/genksyms/parse.y" #line 234 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 40: case 40:
#line 236 "scripts/genksyms/parse.y" #line 235 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 51: case 51:
#line 250 "scripts/genksyms/parse.y" #line 249 "scripts/genksyms/parse.y"
{ (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ; { (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ;
break;} break;}
case 52: case 52:
#line 255 "scripts/genksyms/parse.y" #line 254 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
break;} break;}
case 53: case 53:
#line 259 "scripts/genksyms/parse.y" #line 258 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 56: case 56:
#line 265 "scripts/genksyms/parse.y" #line 264 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 60: case 60:
#line 271 "scripts/genksyms/parse.y" #line 270 "scripts/genksyms/parse.y"
{ /* restrict has no effect in prototypes so ignore it */ { /* restrict has no effect in prototypes so ignore it */
remove_node(yyvsp[0]); remove_node(yyvsp[0]);
yyval = yyvsp[0]; yyval = yyvsp[0];
; ;
break;} break;}
case 61: case 61:
#line 278 "scripts/genksyms/parse.y" #line 277 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 63: case 63:
#line 284 "scripts/genksyms/parse.y" #line 283 "scripts/genksyms/parse.y"
{ if (current_name != NULL) { { if (current_name != NULL) {
error_with_pos("unexpected second declaration name"); error_with_pos("unexpected second declaration name");
YYERROR; YYERROR;
...@@ -1145,115 +1144,113 @@ case 63: ...@@ -1145,115 +1144,113 @@ case 63:
; ;
break;} break;}
case 64: case 64:
#line 293 "scripts/genksyms/parse.y" #line 292 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 65: case 65:
#line 295 "scripts/genksyms/parse.y" #line 294 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 66: case 66:
#line 297 "scripts/genksyms/parse.y" #line 296 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 67: case 67:
#line 299 "scripts/genksyms/parse.y" #line 298 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 68: case 68:
#line 301 "scripts/genksyms/parse.y" #line 300 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 69: case 69:
#line 307 "scripts/genksyms/parse.y" #line 306 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 73: case 73:
#line 315 "scripts/genksyms/parse.y" #line 314 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 74: case 74:
#line 317 "scripts/genksyms/parse.y" #line 316 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 75: case 75:
#line 319 "scripts/genksyms/parse.y" #line 318 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 76: case 76:
#line 321 "scripts/genksyms/parse.y" #line 320 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 77: case 77:
#line 323 "scripts/genksyms/parse.y" #line 322 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 78: case 78:
#line 327 "scripts/genksyms/parse.y" #line 326 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 80: case 80:
#line 329 "scripts/genksyms/parse.y" #line 328 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 81: case 81:
#line 333 "scripts/genksyms/parse.y" #line 332 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 84: case 84:
#line 340 "scripts/genksyms/parse.y" #line 339 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 85: case 85:
#line 345 "scripts/genksyms/parse.y" #line 344 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
break;} break;}
case 86: case 86:
#line 350 "scripts/genksyms/parse.y" #line 349 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
break;} break;}
case 88: case 88:
#line 355 "scripts/genksyms/parse.y" #line 354 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 89: case 89:
#line 357 "scripts/genksyms/parse.y" #line 356 "scripts/genksyms/parse.y"
{ /* For version 2 checksums, we don't want to remember { /* For version 2 checksums, we don't want to remember
private parameter names. */ private parameter names. */
if (checksum_version > 1) remove_node(yyvsp[0]);
remove_node(yyvsp[0]);
yyval = yyvsp[0]; yyval = yyvsp[0];
; ;
break;} break;}
case 90: case 90:
#line 366 "scripts/genksyms/parse.y" #line 364 "scripts/genksyms/parse.y"
{ if (checksum_version > 1) { remove_node(yyvsp[0]);
remove_node(yyvsp[0]);
yyval = yyvsp[0]; yyval = yyvsp[0];
; ;
break;} break;}
case 91: case 91:
#line 371 "scripts/genksyms/parse.y" #line 368 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 92: case 92:
#line 373 "scripts/genksyms/parse.y" #line 370 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 93: case 93:
#line 375 "scripts/genksyms/parse.y" #line 372 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 94: case 94:
#line 377 "scripts/genksyms/parse.y" #line 374 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 95: case 95:
#line 379 "scripts/genksyms/parse.y" #line 376 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 96: case 96:
#line 384 "scripts/genksyms/parse.y" #line 381 "scripts/genksyms/parse.y"
{ struct string_list *decl = *yyvsp[-1]; { struct string_list *decl = *yyvsp[-1];
*yyvsp[-1] = NULL; *yyvsp[-1] = NULL;
add_symbol(current_name, SYM_NORMAL, decl, is_extern); add_symbol(current_name, SYM_NORMAL, decl, is_extern);
...@@ -1261,71 +1258,71 @@ case 96: ...@@ -1261,71 +1258,71 @@ case 96:
; ;
break;} break;}
case 97: case 97:
#line 392 "scripts/genksyms/parse.y" #line 389 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 99: case 99:
#line 399 "scripts/genksyms/parse.y" #line 396 "scripts/genksyms/parse.y"
{ remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ; { remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ;
break;} break;}
case 100: case 100:
#line 403 "scripts/genksyms/parse.y" #line 400 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 101: case 101:
#line 404 "scripts/genksyms/parse.y" #line 401 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 102: case 102:
#line 408 "scripts/genksyms/parse.y" #line 405 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 105: case 105:
#line 414 "scripts/genksyms/parse.y" #line 411 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 106: case 106:
#line 419 "scripts/genksyms/parse.y" #line 416 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 107: case 107:
#line 421 "scripts/genksyms/parse.y" #line 418 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 108: case 108:
#line 425 "scripts/genksyms/parse.y" #line 422 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 111: case 111:
#line 431 "scripts/genksyms/parse.y" #line 428 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 112: case 112:
#line 435 "scripts/genksyms/parse.y" #line 432 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ; { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
break;} break;}
case 113: case 113:
#line 436 "scripts/genksyms/parse.y" #line 433 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 115: case 115:
#line 441 "scripts/genksyms/parse.y" #line 438 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 116: case 116:
#line 445 "scripts/genksyms/parse.y" #line 442 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 118: case 118:
#line 450 "scripts/genksyms/parse.y" #line 447 "scripts/genksyms/parse.y"
{ yyval = yyvsp[0]; ; { yyval = yyvsp[0]; ;
break;} break;}
case 119: case 119:
#line 454 "scripts/genksyms/parse.y" #line 451 "scripts/genksyms/parse.y"
{ yyval = NULL; ; { yyval = NULL; ;
break;} break;}
case 121: case 121:
#line 460 "scripts/genksyms/parse.y" #line 457 "scripts/genksyms/parse.y"
{ export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ; { export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ;
break;} break;}
} }
...@@ -1550,7 +1547,7 @@ yyerrhandle: ...@@ -1550,7 +1547,7 @@ yyerrhandle:
} }
return 1; return 1;
} }
#line 464 "scripts/genksyms/parse.y" #line 461 "scripts/genksyms/parse.y"
static void static void
......
...@@ -179,8 +179,7 @@ decl_specifier: ...@@ -179,8 +179,7 @@ decl_specifier:
storage_class_specifier storage_class_specifier
{ /* Version 2 checksumming ignores storage class, as that { /* Version 2 checksumming ignores storage class, as that
is really irrelevant to the linkage. */ is really irrelevant to the linkage. */
if (checksum_version > 1) remove_node($1);
remove_node($1);
$$ = $1; $$ = $1;
} }
| type_specifier | type_specifier
...@@ -356,15 +355,13 @@ direct_m_abstract_declarator: ...@@ -356,15 +355,13 @@ direct_m_abstract_declarator:
| IDENT | IDENT
{ /* For version 2 checksums, we don't want to remember { /* For version 2 checksums, we don't want to remember
private parameter names. */ private parameter names. */
if (checksum_version > 1) remove_node($1);
remove_node($1);
$$ = $1; $$ = $1;
} }
/* This wasn't really a typedef name but an identifier that /* This wasn't really a typedef name but an identifier that
shadows one. */ shadows one. */
| TYPE | TYPE
{ if (checksum_version > 1) { remove_node($1);
remove_node($1);
$$ = $1; $$ = $1;
} }
| direct_m_abstract_declarator '(' parameter_declaration_clause ')' | direct_m_abstract_declarator '(' parameter_declaration_clause ')'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment