From: Andi Kleen <andi@firstfloor.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, James.Bottomley@HansenPartnership.com,
Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 01/31] Disable const sections for PA-RISC
Date: Sat, 18 Aug 2012 10:29:52 -0700 [thread overview]
Message-ID: <1345311022-26328-2-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1345311022-26328-1-git-send-email-andi@firstfloor.org>
From: Andi Kleen <ak@linux.intel.com>
The PA-RISC tool chain seems to have some problem with correct read/write
attributes on sections. This causes problems when the const sections
are fixed up for other architecture to only contain truly read-only
data.
Disable const sections for PA-RISC
This can cause a bit of noise with modpost.
Cc: James.Bottomley@HansenPartnership.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
arch/parisc/Kconfig | 4 ++++
include/linux/init.h | 27 +++++++++++++++++++--------
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 3ff21b5..fbfeec9 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -243,6 +243,10 @@ config NODES_SHIFT
default "3"
depends on NEED_MULTIPLE_NODES
+config BROKEN_RODATA
+ bool
+ default y
+
source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz"
source "mm/Kconfig"
diff --git a/include/linux/init.h b/include/linux/init.h
index 5e664f6..c2f06b3 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -43,10 +43,21 @@
discard it in modules) */
#define __init __section(.init.text) __cold notrace
#define __initdata __section(.init.data)
-#define __initconst __section(.init.rodata)
+#define __initconst __constsection(.init.rodata)
#define __exitdata __section(.exit.data)
#define __exit_call __used __section(.exitcall.exit)
+/*
+ * Some architecture have tool chains which do not handle rodata attributes
+ * correctly. For those disable special sections for const, so that other
+ * architectures can annotate correctly.
+ */
+#ifdef CONFIG_BROKEN_RODATA
+#define __constsection(x)
+#else
+#define __constsection(x) __section(x)
+#endif
+
/*
* modpost check for section mismatches during the kernel build.
* A section mismatch happens when there are references from a
@@ -66,7 +77,7 @@
*/
#define __ref __section(.ref.text) noinline
#define __refdata __section(.ref.data)
-#define __refconst __section(.ref.rodata)
+#define __refconst __constsection(.ref.rodata)
/* compatibility defines */
#define __init_refok __ref
@@ -85,26 +96,26 @@
/* Used for HOTPLUG */
#define __devinit __section(.devinit.text) __cold notrace
#define __devinitdata __section(.devinit.data)
-#define __devinitconst __section(.devinit.rodata)
+#define __devinitconst __constsection(.devinit.rodata)
#define __devexit __section(.devexit.text) __exitused __cold notrace
#define __devexitdata __section(.devexit.data)
-#define __devexitconst __section(.devexit.rodata)
+#define __devexitconst __constsection(.devexit.rodata)
/* Used for HOTPLUG_CPU */
#define __cpuinit __section(.cpuinit.text) __cold notrace
#define __cpuinitdata __section(.cpuinit.data)
-#define __cpuinitconst __section(.cpuinit.rodata)
+#define __cpuinitconst __constsection(.cpuinit.rodata)
#define __cpuexit __section(.cpuexit.text) __exitused __cold notrace
#define __cpuexitdata __section(.cpuexit.data)
-#define __cpuexitconst __section(.cpuexit.rodata)
+#define __cpuexitconst __constsection(.cpuexit.rodata)
/* Used for MEMORY_HOTPLUG */
#define __meminit __section(.meminit.text) __cold notrace
#define __meminitdata __section(.meminit.data)
-#define __meminitconst __section(.meminit.rodata)
+#define __meminitconst __constsection(.meminit.rodata)
#define __memexit __section(.memexit.text) __exitused __cold notrace
#define __memexitdata __section(.memexit.data)
-#define __memexitconst __section(.memexit.rodata)
+#define __memexitconst __constsection(.memexit.rodata)
/* For assembly routines */
#define __HEAD .section ".head.text","ax"
--
1.7.7.6
next prev parent reply other threads:[~2012-08-18 17:31 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-18 17:29 Const section fixes tree sweep Andi Kleen
2012-08-18 17:29 ` Andi Kleen [this message]
2012-08-18 21:15 ` [PATCH 01/31] Disable const sections for PA-RISC Sam Ravnborg
2012-08-19 2:07 ` Andi Kleen
2012-08-19 7:41 ` Sam Ravnborg
2012-08-18 17:29 ` [PATCH 02/31] sections: Fix section conflicts in arch/arm/ Andi Kleen
2012-08-18 17:29 ` [PATCH 03/31] sections: Fix section conflicts in arch/frv Andi Kleen
2012-10-11 12:38 ` Geert Uytterhoeven
2012-10-11 23:20 ` Andi Kleen
2012-10-15 11:13 ` David Howells
2012-08-18 17:29 ` [PATCH 04/31] sections: Fix section conflicts in arch/h8300 Andi Kleen
2012-08-18 17:29 ` [PATCH 05/31] sections: Fix section conflicts in arch/ia64 Andi Kleen
2012-08-18 17:29 ` [PATCH 06/31] sections: Fix section conflicts in arch/mips Andi Kleen
2012-08-18 17:29 ` [PATCH 07/31] sections: Fix section conflicts in arch/powerpc Andi Kleen
2012-08-18 17:29 ` [PATCH 08/31] sections: Fix section conflicts in arch/score Andi Kleen
2012-08-18 17:30 ` [PATCH 09/31] sections: Fix section conflicts in arch/sh Andi Kleen
2012-08-18 17:30 ` [PATCH 10/31] sections: Fix section conflicts in arch/x86 Andi Kleen
2012-08-18 17:30 ` [PATCH 11/31] sections: Fix section conflicts in drivers/atm Andi Kleen
2012-08-18 17:30 ` [PATCH 12/31] sections: Fix section conflicts in drivers/char Andi Kleen
2012-08-18 17:30 ` [PATCH 13/31] sections: Fix section conflicts in drivers/cpufreq Andi Kleen
2012-08-18 17:30 ` [PATCH 14/31] sections: Fix section conflicts in drivers/hwmon Andi Kleen
2012-08-18 23:23 ` Guenter Roeck
2012-08-19 1:59 ` Andi Kleen
2012-08-19 5:12 ` Guenter Roeck
2012-08-18 17:30 ` [PATCH 15/31] sections: Fix section conflicts in drivers/ide Andi Kleen
2012-08-18 17:30 ` [PATCH 16/31] sections: Fix section conflicts in drivers/macintosh Andi Kleen
2012-08-18 17:30 ` [PATCH 17/31] sections: Fix section conflicts in drivers/media Andi Kleen
2012-08-18 17:30 ` [PATCH 18/31] sections: Fix section conflicts in drivers/mfd Andi Kleen
2012-08-18 17:30 ` [PATCH 19/31] sections: Fix section conflicts in drivers/misc Andi Kleen
2012-08-18 17:30 ` [PATCH 20/31] sections: Fix section conflicts in drivers/mmc Andi Kleen
2012-08-18 17:30 ` [PATCH 21/31] sections: Fix section conflicts in drivers/net Andi Kleen
2012-08-18 17:30 ` [PATCH 22/31] sections: Fix section conflicts in drivers/net/hamradio Andi Kleen
2012-08-18 17:30 ` [PATCH 23/31] sections: Fix section conflicts in drivers/net/wan Andi Kleen
2012-08-18 17:30 ` [PATCH 24/31] sections: Fix section conflicts in drivers/platform/x86 Andi Kleen
2012-08-18 17:30 ` [PATCH 25/31] sections: Fix section conflicts in drivers/scsi Andi Kleen
2012-08-18 17:30 ` [PATCH 26/31] sections: Fix section conflicts in drivers/video Andi Kleen
2012-08-18 17:30 ` [PATCH 27/31] sections: Fix section conflicts in mm/percpu Andi Kleen
2012-08-18 17:30 ` [PATCH 28/31] sections: Fix section conflicts in net/can Andi Kleen
2012-08-18 17:30 ` [PATCH 29/31] sections: Fix section conflicts in net Andi Kleen
2012-08-18 17:30 ` [PATCH 30/31] sections: Fix section conflicts in sound Andi Kleen
2012-08-18 17:30 ` [PATCH 31/31] Fix const sections for crc32 table Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345311022-26328-2-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).