diff options
author | He Zhe <zhe.he@windriver.com> | 2019-08-20 10:53:10 -0400 |
---|---|---|
committer | Jessica Yu <jeyu@kernel.org> | 2019-08-21 04:43:56 -0400 |
commit | 3b5be16c7e90a69c93349d210766250fffcb54bd (patch) | |
tree | 51ee2d4207b59df48a4123070713d7772838f7d6 /kernel/module.c | |
parent | 38f054d549a869f22a02224cd276a27bf14b6171 (diff) |
modules: page-align module section allocations only for arches supporting strict module rwx
We should keep the case of "#define debug_align(X) (X)" for all arches
without CONFIG_HAS_STRICT_MODULE_RWX ability, which would save people, who
are sensitive to system size, a lot of memory when using modules,
especially for embedded systems. This is also the intention of the
original #ifdef... statement and still valid for now.
Note that this still keeps the effect of the fix of the following commit,
38f054d549a8 ("modules: always page-align module section allocations"),
since when CONFIG_ARCH_HAS_STRICT_MODULE_RWX is enabled, module pages are
aligned.
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c index cd8df516666d..9ee93421269c 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -64,9 +64,14 @@ | |||
64 | 64 | ||
65 | /* | 65 | /* |
66 | * Modules' sections will be aligned on page boundaries | 66 | * Modules' sections will be aligned on page boundaries |
67 | * to ensure complete separation of code and data | 67 | * to ensure complete separation of code and data, but |
68 | * only when CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y | ||
68 | */ | 69 | */ |
70 | #ifdef CONFIG_ARCH_HAS_STRICT_MODULE_RWX | ||
69 | # define debug_align(X) ALIGN(X, PAGE_SIZE) | 71 | # define debug_align(X) ALIGN(X, PAGE_SIZE) |
72 | #else | ||
73 | # define debug_align(X) (X) | ||
74 | #endif | ||
70 | 75 | ||
71 | /* If this is set, the section belongs in the init part of the module */ | 76 | /* If this is set, the section belongs in the init part of the module */ |
72 | #define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1)) | 77 | #define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1)) |