modpost: make sym_add_exported() always allocate a new symbol
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 1 May 2022 08:40:18 +0000 (17:40 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 7 May 2022 18:17:01 +0000 (03:17 +0900)
commite76cc48d8e6df5d949284132981db73d2dd8c6b5
treeed301148e5ef73e945734f37aa5082da06fc18c7
parentb8422711080f57cdf9fb1c0cb8683a2112bed27c
modpost: make sym_add_exported() always allocate a new symbol

Currently, sym_add_exported() does not allocate a symbol if the same
name symbol already exists in the hash table.

This does not reflect the real use cases. You can let an external
module override the in-tree one. In this case, the external module
will export the same name symbols as the in-tree one. However,
modpost simply ignores those symbols, then Module.symvers for the
external module loses its symbols.

sym_add_exported() should allocate a new symbol.

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