summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2008-12-01 14:21:03 -0800
committerSam Ravnborg <sam@ravnborg.org>2008-12-03 22:33:12 +0100
commit5dae9a550a7478c8d6a7da2336d3ceeebf90ab84 (patch)
tree15936b08138ed2f8abfee946c3f2c31b76a4e491 /scripts
parent64e6c1e12372840e7caf8e25325a9e9c5fd370e6 (diff)
downloadblackbird-op-linux-5dae9a550a7478c8d6a7da2336d3ceeebf90ab84.tar.gz
blackbird-op-linux-5dae9a550a7478c8d6a7da2336d3ceeebf90ab84.zip
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 <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/genksyms.c34
-rw-r--r--scripts/genksyms/genksyms.h1
2 files changed, 31 insertions, 4 deletions
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c
index ddac1746908e..3a8297b5184c 100644
--- a/scripts/genksyms/genksyms.c
+++ b/scripts/genksyms/genksyms.c
@@ -191,11 +191,26 @@ struct symbol *__add_symbol(const char *name, enum symbol_type type,
/* fall through */ ;
else if (sym->type == type &&
equal_list(sym->defn, defn)) {
+ if (!sym->is_declared && sym->is_override) {
+ print_location();
+ print_type_name(type, name);
+ fprintf(stderr, " modversion is "
+ "unchanged\n");
+ }
sym->is_declared = 1;
return sym;
} else if (!sym->is_declared) {
- status = is_unknown_symbol(sym) ?
- STATUS_DEFINED : STATUS_MODIFIED;
+ if (sym->is_override && flag_preserve) {
+ print_location();
+ fprintf(stderr, "ignoring ");
+ print_type_name(type, name);
+ fprintf(stderr, " modversion change\n");
+ sym->is_declared = 1;
+ return sym;
+ } else {
+ status = is_unknown_symbol(sym) ?
+ STATUS_DEFINED : STATUS_MODIFIED;
+ }
} else {
error_with_pos("redefinition of %s", name);
return sym;
@@ -229,6 +244,7 @@ struct symbol *__add_symbol(const char *name, enum symbol_type type,
sym->is_declared = !is_reference;
sym->status = status;
+ sym->is_override = 0;
if (flag_debug) {
fprintf(debugfile, "Defn for %s %s == <",
@@ -348,9 +364,16 @@ static void read_reference(FILE *f)
while (!feof(f)) {
struct string_list *defn = NULL;
struct string_list *sym, *def;
- int is_extern = 0;
+ int is_extern = 0, is_override = 0;
+ struct symbol *subsym;
sym = read_node(f);
+ if (sym && sym->tag == SYM_NORMAL &&
+ !strcmp(sym->string, "override")) {
+ is_override = 1;
+ free_node(sym);
+ sym = read_node(f);
+ }
if (!sym)
continue;
def = read_node(f);
@@ -365,8 +388,9 @@ static void read_reference(FILE *f)
defn = def;
def = read_node(f);
}
- add_reference_symbol(xstrdup(sym->string), sym->tag,
+ subsym = add_reference_symbol(xstrdup(sym->string), sym->tag,
defn, is_extern);
+ subsym->is_override = is_override;
free_node(sym);
}
}
@@ -743,6 +767,8 @@ int main(int argc, char **argv)
while (visited_symbols != (struct symbol *)-1L) {
struct symbol *sym = visited_symbols;
+ if (sym->is_override)
+ fputs("override ", dumpfile);
if (sym->type != SYM_NORMAL) {
putc(symbol_type_name[sym->type][0], dumpfile);
putc('#', dumpfile);
diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h
index 2831158426cd..25c4d40cefc1 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;
OpenPOWER on IntegriCloud