modpost: dump Module.symvers in the same order of modules.order
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 1 May 2022 08:40:15 +0000 (17:40 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 May 2022 18:17:01 +0000 (03:17 +0900)
commitf841536e8c5b28e1fbf8743911ae1dc78993abd4
tree5dd6e9b6bdf9b9be4a3fad7f71423989953751c4
parentab489d6002fc27dc5db6d66f121da6fc0bda13ad
modpost: dump Module.symvers in the same order of modules.order

modpost dumps the exported symbols into Module.symvers, but currently
in random order because it iterates in the hash table.

Add a linked list of exported symbols in struct module, so we can
iterate on symbols per module.

This commit makes Module.symvers much more readable; the outer loop in
write_dump() iterates over the modules in the order of modules.order,
and the inner loop dumps symbols in each module.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/mod/modpost.c
scripts/mod/modpost.h