From 64e6c1e12372840e7caf8e25325a9e9c5fd370e6 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 1 Dec 2008 14:21:01 -0800 Subject: genksyms: track symbol checksum changes Sometimes it is preferable to avoid changes of exported symbol checksums (to avoid breaking externally provided modules). When a checksum change occurs, it can be hard to figure out what caused this change: underlying types may have changed, or additional type information may simply have become available at the point where a symbol is exported. Add a new --reference option to genksyms which allows it to report why checksums change, based on the type information dumps it creates with the --dump-types flag. Genksyms will read in such a dump from a previous run, and report which symbols have changed (and why). The behavior can be controlled for an entire build as follows: If KBUILD_SYMTYPES is set, genksyms uses --dump-types to produce *.symtypes dump files. If any *.symref files exist, those will be used as the reference to check against. If KBUILD_PRESERVE is set, checksum changes will fail the build. Signed-off-by: Andreas Gruenbacher Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/genksyms/genksyms.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/genksyms/genksyms.h') diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 2668287aa49..2831158426c 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h @@ -29,6 +29,10 @@ enum symbol_type { SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION }; +enum symbol_status { + STATUS_UNCHANGED, STATUS_DEFINED, STATUS_MODIFIED +}; + struct string_list { struct string_list *next; enum symbol_type tag; @@ -43,6 +47,8 @@ struct symbol { struct symbol *expansion_trail; struct symbol *visited; int is_extern; + int is_declared; + enum symbol_status status; }; typedef struct string_list **yystype; -- cgit v1.2.3 From 5dae9a550a7478c8d6a7da2336d3ceeebf90ab84 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 1 Dec 2008 14:21:03 -0800 Subject: genksyms: allow to ignore symbol checksum changes This adds an "override" keyword for use in *.symvers / *.symref files. When a symbol is overridden, the symbol's old definition will be used for computing checksums instead of the new one, preserving the previous checksum. (Genksyms will still warn about the change.) This is meant to allow distributions to hide minor actual as well as fake ABI changes. (For example, when extra type information becomes available because additional headers are included, this may change checksums even though none of the types used have actully changed.) This approach also allows to get rid of "#ifdef __GENKSYMS__" hacks in the code, which are currently used in some vendor kernels to work around checksum changes. Signed-off-by: Andreas Gruenbacher Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Sam Ravnborg --- scripts/genksyms/genksyms.h | 1 + 1 file changed, 1 insertion(+) (limited to 'scripts/genksyms/genksyms.h') diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h index 2831158426c..25c4d40cefc 100644 --- a/scripts/genksyms/genksyms.h +++ b/scripts/genksyms/genksyms.h @@ -49,6 +49,7 @@ struct symbol { int is_extern; int is_declared; enum symbol_status status; + int is_override; }; typedef struct string_list **yystype; -- cgit v1.2.3