[PATCH] x86/x86_64: mark rodata section read-only: make some datastructures const
authorArjan van de Ven <arjan@infradead.org>
Fri, 6 Jan 2006 08:12:05 +0000 (00:12 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 6 Jan 2006 16:33:36 +0000 (08:33 -0800)
Mark some key kernel datastructures readonly.  This patch was previously
posted on Jun 28th but was back then not merged because nothing was enforcing
rodata anyway..  well that changed now :)

Patch by Christoph Lameter <christoph@lameter.com> and Dave Jones
<davej@redhat.com>

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/entry.S
arch/i386/kernel/syscall_table.S
arch/x86_64/ia32/ia32entry.S
arch/x86_64/kernel/syscall.c

index e50b93155249b79732378ccbc6d4bc41c2d74207..607c0600750894e21f2beeb423101ab2e56f5952 100644 (file)
@@ -657,6 +657,7 @@ ENTRY(spurious_interrupt_bug)
        pushl $do_spurious_interrupt_bug
        jmp error_code
 
+.section .rodata,"a"
 #include "syscall_table.S"
 
 syscall_table_size=(.-sys_call_table)
index 9b21a31d4f4ec1b32b4d6c438d236c6332a19759..f7ba4acc20ec3d7049d77b8d417e95e49e94787a 100644 (file)
@@ -1,4 +1,3 @@
-.data
 ENTRY(sys_call_table)
        .long sys_restart_syscall       /* 0 - old "setup()" system call, used for restarting */
        .long sys_exit
index e0eb0c712fe91fbddfc74beb9048eace392e1566..df0773c9bdbe70337e236bd6c267e91bedcaf465 100644 (file)
@@ -341,7 +341,7 @@ ENTRY(ia32_ptregs_common)
        jmp  ia32_sysret        /* misbalances the return cache */
        CFI_ENDPROC
 
-       .data
+       .section .rodata,"a"
        .align 8
        .globl ia32_sys_call_table
 ia32_sys_call_table:
index e263685f864cac46228a7585d2ef9f3a9584a01e..7c176b3edde00daab10dfaed6d954d7412d9541d 100644 (file)
@@ -19,7 +19,7 @@ typedef void (*sys_call_ptr_t)(void);
 
 extern void sys_ni_syscall(void);
 
-sys_call_ptr_t sys_call_table[__NR_syscall_max+1] __cacheline_aligned = { 
+const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
        /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ 
        [0 ... __NR_syscall_max] = &sys_ni_syscall,
 #include <asm-x86_64/unistd.h>