From: Gustavo Sverzut Barbieri Date: Fri, 23 Dec 2011 03:27:28 +0000 (-0200) Subject: kmod-depmod: dump modules.symbols X-Git-Tag: v3~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a14d0e98904a848259c4b6f0a8e137018619da6;p=thirdparty%2Fkmod.git kmod-depmod: dump modules.symbols note that the hash algorithm is different thus the output order will be different as well. to compare the outputs, sort the files: depmod -n | grep '^alias symbol:' | sort > /tmp/orig kmod-depmod -n | grep '^alias symbol:' | sort > /tmp/new diff /tmp/orig /tmp/new --- diff --git a/tools/kmod-depmod.c b/tools/kmod-depmod.c index 99897054..6b78f664 100644 --- a/tools/kmod-depmod.c +++ b/tools/kmod-depmod.c @@ -1676,6 +1676,28 @@ static int depmod_load(struct depmod *depmod) return 0; } +static int output_symbols(struct depmod *depmod, FILE *out) +{ + size_t i; + + fputs("# Aliases for symbols, used by symbol_request().\n", out); + + for (i = 0; i < depmod->symbols->n_buckets; i++) { + const struct hash_bucket *b = depmod->symbols->buckets + i; + unsigned j; + for (j = 0; j < b->used; j++) { + const struct hash_entry *e = b->entries + j; + const struct symbol *sym = e->value; + if (sym->owner == NULL) + continue; + fprintf(out, "alias symbol:%s %s\n", + sym->name, sym->owner->modname); + } + } + + return 0; +} + static int output_devname(struct depmod *depmod, FILE *out) { size_t i; @@ -1740,7 +1762,7 @@ static int depmod_output(struct depmod *depmod, FILE *out) //{"modules.alias", output_aliases}, //{"modules.alias.bin", output_aliases_bin}, //{"modules.softdep", output_softdeps}, - //{"modules.symbols", output_symbols}, + {"modules.symbols", output_symbols}, //{"modules.symbols.bin", output_symbols_bin}, //{"modules.builtin.bin", output_builtin_bin}, {"modules.devname", output_devname},