381fffb
>From e540f21852043a4d8e8cf5e505607909d0ab0f51 Mon Sep 17 00:00:00 2001
381fffb
From: Tim Gardner <tim.gardner@canonical.com>
381fffb
Date: Thu, 29 Mar 2012 06:21:01 -0600
381fffb
Subject: [PATCH] UBUNTU: SAUCE: disable_nx should not be in __cpuinitdata
381fffb
 section for X86_32
381fffb
381fffb
I noticed a section mismatch warning while building 3.2.0-20.33 for X86_32.
381fffb
381fffb
 AR      arch/x86/lib/lib.a
381fffb
  LD      vmlinux.o
381fffb
  MODPOST vmlinux.o
381fffb
WARNING: vmlinux.o(.text+0x187833): Section mismatch in reference from the function load_elf_binary() to the variable .cpuinit.data:disable_nx
381fffb
The function load_elf_binary() references
381fffb
the variable __cpuinitdata disable_nx.
381fffb
This is often because load_elf_binary lacks a __cpuinitdata
381fffb
annotation or the annotation of disable_nx is wrong.
381fffb
381fffb
load_elf_binary() is definitely called after initialization.
381fffb
381fffb
This code was added by 'UBUNTU: ubuntu: nx-emu - i386: NX emulation', so
381fffb
this is not an upstream problem.
381fffb
381fffb
Reported-by: Tetsuo Handa <from-ubuntu@I-love.SAKURA.ne.jp>
381fffb
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
381fffb
---
381fffb
 arch/x86/mm/setup_nx.c |    4 ++++
381fffb
 1 files changed, 4 insertions(+), 0 deletions(-)
381fffb
381fffb
diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c
381fffb
index 90c9eff3..89fd946 100644
381fffb
--- a/arch/x86/mm/setup_nx.c
381fffb
+++ b/arch/x86/mm/setup_nx.c
381fffb
@@ -6,7 +6,11 @@
381fffb
 #include <asm/pgtable.h>
381fffb
 #include <asm/proto.h>
381fffb
 
381fffb
+#ifdef CONFIG_X86_32
381fffb
+int disable_nx; /* referenced by load_elf_binary() */
381fffb
+#else
381fffb
 int disable_nx __cpuinitdata;
381fffb
+#endif
381fffb
 
381fffb
 /*
381fffb
  * noexec = on|off
381fffb
-- 
381fffb
1.7.9.1
381fffb