diff options
author | Christophe Leroy <[email protected]> | 2017-10-03 16:15:16 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2017-10-03 17:54:24 -0700 |
commit | a872eb2131e91ce7c89a8888974a5e22a272b12f (patch) | |
tree | 268453c4f17ca01b42c9b841559a83572a019f19 | |
parent | 31d1e130f4a0f8f629a460167569577cac9b17c1 (diff) |
mm: fix RODATA_TEST failure "rodata_test: test data was not read only"
On powerpc, RODATA_TEST fails with message the following messages:
Freeing unused kernel memory: 528K
rodata_test: test data was not read only
This is because GCC allocates it to .data section:
c0695034 g O .data 00000004 rodata_test_data
Since commit 056b9d8a7692 ("mm: remove rodata_test_data export, add
pr_fmt"), rodata_test_data is used only inside rodata_test.c By
declaring it static, it gets properly allocated into .rodata section
instead of .data:
c04df710 l O .rodata 00000004 rodata_test_data
Fixes: 056b9d8a7692 ("mm: remove rodata_test_data export, add pr_fmt")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Christophe Leroy <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Jinbum Park <[email protected]>
Cc: Segher Boessenkool <[email protected]>
Cc: David Laight <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/rodata_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/rodata_test.c b/mm/rodata_test.c index 6bb4deb12e78..d908c8769b48 100644 --- a/mm/rodata_test.c +++ b/mm/rodata_test.c @@ -14,7 +14,7 @@ #include <linux/uaccess.h> #include <asm/sections.h> -const int rodata_test_data = 0xC3; +static const int rodata_test_data = 0xC3; void rodata_test(void) { |