[PATCH] add __[start|end]_rodata sections to asm-generic/sections.h
Add __start_rodata and __end_rodata to sections.h to avoid extern declarations. Needed by s390 code (see following patch). [akpm@osdl.org: update architectures] Cc: Arjan van de Ven <arjan@infradead.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Andi Kleen <ak@muc.de> Acked-by: Kyle McMartin <kyle@mcmartin.ca> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e2c2770096
commit
a581c2a469
@ -725,16 +725,15 @@ static int noinline do_test_wp_bit(void)
|
||||
|
||||
#ifdef CONFIG_DEBUG_RODATA
|
||||
|
||||
extern char __start_rodata, __end_rodata;
|
||||
void mark_rodata_ro(void)
|
||||
{
|
||||
unsigned long addr = (unsigned long)&__start_rodata;
|
||||
unsigned long addr = (unsigned long)__start_rodata;
|
||||
|
||||
for (; addr < (unsigned long)&__end_rodata; addr += PAGE_SIZE)
|
||||
for (; addr < (unsigned long)__end_rodata; addr += PAGE_SIZE)
|
||||
change_page_attr(virt_to_page(addr), 1, PAGE_KERNEL_RO);
|
||||
|
||||
printk ("Write protecting the kernel read-only data: %luk\n",
|
||||
(unsigned long)(&__end_rodata - &__start_rodata) >> 10);
|
||||
printk("Write protecting the kernel read-only data: %uk\n",
|
||||
(__end_rodata - __start_rodata) >> 10);
|
||||
|
||||
/*
|
||||
* change_page_attr() requires a global_flush_tlb() call after it.
|
||||
|
Reference in New Issue
Block a user