diff options
author | Matthias Maennich <maennich@google.com> | 2020-04-07 09:17:26 +0200 |
---|---|---|
committer | Matthias Maennich <maennich@google.com> | 2020-04-07 09:17:26 +0200 |
commit | 70ceb708e6c649c3f37a6f2bd8eda9f5e8aa01d5 (patch) | |
tree | 5d6f51b286cf476b1128c211db7bce481caec2a2 | |
parent | 2a2a5063fbffa1dc9bcb5e433076f943378e13c0 (diff) | |
download | build-70ceb708e6c649c3f37a6f2bd8eda9f5e8aa01d5.tar.gz |
abi/extract_symbols: Emit whitelists for all modules with --emit-module-whitelists
When using --emit-module-whitelists, we only were emitting symbols that
had a unique symbol usage. That is obviously not the intended behaviour
and this patch fixes it by first emitting the module specific whitelist
before working on the common one.
Fixes: 747e97df3303 ("abi/extract_symbols: Add option to generate per-module whitelists")
Signed-off-by: Matthias Maennich <maennich@google.com>
Change-Id: I14fad93afdb58a4744a7c82a495dd92d0a8dc6ce
-rwxr-xr-x | abi/extract_symbols | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/abi/extract_symbols b/abi/extract_symbols index a025f6e5..47d00f47 100755 --- a/abi/extract_symbols +++ b/abi/extract_symbols @@ -140,6 +140,14 @@ def create_whitelist(whitelist, undefined_symbols, exported, for module, symbols in undefined_symbols.items(): + if emit_module_whitelists: + mod_wl_file = whitelist + "_" + os.path.splitext(module)[0] + with open(mod_wl_file, "w") as mod_wl: + # write the header + mod_wl.write("[abi_whitelist]\n ") + mod_wl.write("\n ".join(symbols)) + mod_wl.write("\n") + new_wl_section = symbol_sort([ symbol for symbol in symbols if symbol in exported and symbol not in common_wl_section @@ -152,14 +160,6 @@ def create_whitelist(whitelist, undefined_symbols, exported, wl.write("\n ".join(new_wl_section)) wl.write("\n") - if emit_module_whitelists: - mod_wl_file = whitelist + "_" + os.path.splitext(module)[0] - with open(mod_wl_file, "w") as mod_wl: - # write the header - mod_wl.write("[abi_whitelist]\n ") - mod_wl.write("\n ".join(symbols)) - mod_wl.write("\n") - def main(): """Extract the required symbols for a directory full of kernel modules.""" |