aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/mm/init.c9
-rw-r--r--arch/parisc/mm/init.c4
-rw-r--r--arch/x86_64/mm/init.c7
-rw-r--r--include/asm-generic/sections.h1
4 files changed, 10 insertions, 11 deletions
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c
index dc5d8979cd64..89e8486aac34 100644
--- a/arch/i386/mm/init.c
+++ b/arch/i386/mm/init.c
@@ -725,16 +725,15 @@ static int noinline do_test_wp_bit(void)
725 725
726#ifdef CONFIG_DEBUG_RODATA 726#ifdef CONFIG_DEBUG_RODATA
727 727
728extern char __start_rodata, __end_rodata;
729void mark_rodata_ro(void) 728void mark_rodata_ro(void)
730{ 729{
731 unsigned long addr = (unsigned long)&__start_rodata; 730 unsigned long addr = (unsigned long)__start_rodata;
732 731
733 for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE) 732 for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE)
734 change_page_attr(virt_to_page(addr), 1, PAGE_KERNEL_RO); 733 change_page_attr(virt_to_page(addr), 1, PAGE_KERNEL_RO);
735 734
736 printk ("Write protecting the kernel read-only data: %luk\n", 735 printk("Write protecting the kernel read-only data: %uk\n",
737 (unsigned long)(&__end_rodata - &__start_rodata) >> 10); 736 (__end_rodata - __start_rodata) >> 10);
738 737
739 /* 738 /*
740 * change_page_attr() requires a global_flush_tlb() call after it. 739 * change_page_attr() requires a global_flush_tlb() call after it.
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index b64602a99d89..f2b96f1e0da7 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -27,6 +27,7 @@
27#include <asm/tlb.h> 27#include <asm/tlb.h>
28#include <asm/pdc_chassis.h> 28#include <asm/pdc_chassis.h>
29#include <asm/mmzone.h> 29#include <asm/mmzone.h>
30#include <asm/sections.h>
30 31
31DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 32DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
32 33
@@ -417,11 +418,10 @@ void free_initmem(void)
417#ifdef CONFIG_DEBUG_RODATA 418#ifdef CONFIG_DEBUG_RODATA
418void mark_rodata_ro(void) 419void mark_rodata_ro(void)
419{ 420{
420 extern char __start_rodata, __end_rodata;
421 /* rodata memory was already mapped with KERNEL_RO access rights by 421 /* rodata memory was already mapped with KERNEL_RO access rights by
422 pagetable_init() and map_pages(). No need to do additional stuff here */ 422 pagetable_init() and map_pages(). No need to do additional stuff here */
423 printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n", 423 printk (KERN_INFO "Write protecting the kernel read-only data: %luk\n",
424 (unsigned long)(&__end_rodata - &__start_rodata) >> 10); 424 (unsigned long)(__end_rodata - __start_rodata) >> 10);
425} 425}
426#endif 426#endif
427 427
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c
index 72f140f81b70..d14fb2dfbfc4 100644
--- a/arch/x86_64/mm/init.c
+++ b/arch/x86_64/mm/init.c
@@ -678,16 +678,15 @@ void free_initmem(void)
678 678
679#ifdef CONFIG_DEBUG_RODATA 679#ifdef CONFIG_DEBUG_RODATA
680 680
681extern char __start_rodata, __end_rodata;
682void mark_rodata_ro(void) 681void mark_rodata_ro(void)
683{ 682{
684 unsigned long addr = (unsigned long)&__start_rodata; 683 unsigned long addr = (unsigned long)__start_rodata;
685 684
686 for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE) 685 for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE)
687 change_page_attr_addr(addr, 1, PAGE_KERNEL_RO); 686 change_page_attr_addr(addr, 1, PAGE_KERNEL_RO);
688 687
689 printk ("Write protecting the kernel read-only data: %luk\n", 688 printk ("Write protecting the kernel read-only data: %luk\n",
690 (&__end_rodata - &__start_rodata) >> 10); 689 (__end_rodata - __start_rodata) >> 10);
691 690
692 /* 691 /*
693 * change_page_attr_addr() requires a global_flush_tlb() call after it. 692 * change_page_attr_addr() requires a global_flush_tlb() call after it.
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 0b49f9e070f1..962cad7cfbbd 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -14,5 +14,6 @@ extern char _end[];
14extern char __per_cpu_start[], __per_cpu_end[]; 14extern char __per_cpu_start[], __per_cpu_end[];
15extern char __kprobes_text_start[], __kprobes_text_end[]; 15extern char __kprobes_text_start[], __kprobes_text_end[];
16extern char __initdata_begin[], __initdata_end[]; 16extern char __initdata_begin[], __initdata_end[];
17extern char __start_rodata[], __end_rodata[];
17 18
18#endif /* _ASM_GENERIC_SECTIONS_H_ */ 19#endif /* _ASM_GENERIC_SECTIONS_H_ */