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 9989705..6b78f66 100644
--- a/tools/kmod-depmod.c
+++ b/tools/kmod-depmod.c
@@ -1676,6 +1676,28 @@
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 @@
//{"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},