modules: fix compile error if don't have strict module rwx
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 25 Jun 2019 09:40:28 +0000 (17:40 +0800)
committerJessica Yu <jeyu@kernel.org>
Wed, 26 Jun 2019 17:27:59 +0000 (19:27 +0200)
commit93651f80dcb616b8c9115cdafc8e57a781af22d0
treec2612618459c3b0569a3b3668687dfaec5e7d7cf
parent70bac08d4157fda334fe21ee38a2e93bc434bac4
modules: fix compile error if don't have strict module rwx

If CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not defined,
we need stub for module_enable_nx() and module_enable_x().

If CONFIG_ARCH_HAS_STRICT_MODULE_RWX is defined, but
CONFIG_STRICT_MODULE_RWX is disabled, we need stub for
module_enable_nx.

Move frob_text() outside of the CONFIG_STRICT_MODULE_RWX,
because it is needed anyway.

Fixes: 2eef1399a866 ("modules: fix BUG when load module with rodata=n")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
kernel/module.c