linux/scripts/genksyms
Michal Marek e37ddb8250 genksyms: Track changes to enum constants
Enum constants can be used as array sizes; if the enum itself does not
appear in the symbol expansion, a change in the enum constant will go
unnoticed. Example patch that changes the ABI but does not change the
checksum with current genksyms:

| enum e {
|	E1,
|	E2,
|+	E3,
|	E_MAX
| };
|
| struct s {
|	int a[E_MAX];
| }
|
| int f(struct s *s) { ... }
| EXPORT_SYMBOL(f)

Therefore, remember the value of each enum constant and
expand each occurence to <constant> <value>. The value is not actually
computed, but instead an expression in the form
(last explicitly assigned value) + N
is used. This avoids having to parse and semantically understand whole
of C.

Note: The changes won't take effect until the lexer and parser are
rebuilt by the next patch.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
2011-03-17 15:13:56 +01:00
..
.gitignore gitignore: misc files 2006-01-01 22:21:50 +01:00
genksyms.c genksyms: Track changes to enum constants 2011-03-17 15:13:56 +01:00
genksyms.h genksyms: Track changes to enum constants 2011-03-17 15:13:56 +01:00
keywords.c_shipped genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}() 2009-12-12 13:08:16 +01:00
keywords.gperf genksyms: properly consider EXPORT_UNUSED_SYMBOL{,_GPL}() 2009-12-12 13:08:16 +01:00
lex.c_shipped genksyms: simplify usage of find_symbol() 2011-03-17 15:13:55 +01:00
lex.l genksyms: Track changes to enum constants 2011-03-17 15:13:56 +01:00
Makefile genksyms: Do not paste the bison header file to lex.c 2011-03-17 15:13:55 +01:00
parse.c_shipped scripts/genksyms: fix header usage 2010-11-25 16:25:06 +01:00
parse.h_shipped kbuild: apply genksyms changes 2007-10-12 21:15:31 +02:00
parse.y genksyms: Track changes to enum constants 2011-03-17 15:13:56 +01:00