aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-21 15:03:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-21 15:03:04 -0400
commit080e89270a7bfb7d01fac9a67050f8ac6d6cdd11 (patch)
tree489e467292ca06420e85f185095323efb80c75b7 /include
parent4b85df0419d1fb135d9d845876e8c7ee1393f83c (diff)
parent38bdc32af442b6ab09ed61b8b669072098c95dd2 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fix
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fix: mm/slab: fix section mismatch warning mm: fix section mismatch warnings init/main: use __init_refok to fix section mismatch kbuild: introduce __init_refok/__initdata_refok to supress section mismatch warnings all-archs: consolidate .data section definition in asm-generic all-archs: consolidate .text section definition in asm-generic kbuild: add "Section mismatch" warning whitelist for powerpc kbuild: make better section mismatch reports on i386, arm and mips kbuild: make modpost section warnings clearer kconfig: search harder for curses library in check-lxdialog.sh kbuild: include limits.h in sumversion.c for PATH_MAX powerpc: Fix the MODALIAS generation in modpost for of devices
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/vmlinux.lds.h12
-rw-r--r--include/linux/init.h13
2 files changed, 25 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index f3806a74c478..8307b1bb337a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -9,6 +9,11 @@
9/* Align . to a 8 byte boundary equals to maximum function alignment. */ 9/* Align . to a 8 byte boundary equals to maximum function alignment. */
10#define ALIGN_FUNCTION() . = ALIGN(8) 10#define ALIGN_FUNCTION() . = ALIGN(8)
11 11
12/* .data section */
13#define DATA_DATA \
14 *(.data) \
15 *(.data.init.refok)
16
12#define RODATA \ 17#define RODATA \
13 . = ALIGN(4096); \ 18 . = ALIGN(4096); \
14 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ 19 .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
@@ -139,6 +144,13 @@
139 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 144 VMLINUX_SYMBOL(__security_initcall_end) = .; \
140 } 145 }
141 146
147/* .text section. Map to function alignment to avoid address changes
148 * during second ld run in second ld pass when generating System.map */
149#define TEXT_TEXT \
150 ALIGN_FUNCTION(); \
151 *(.text) \
152 *(.text.init.refok)
153
142/* sched.text is aling to function alignment to secure we have same 154/* sched.text is aling to function alignment to secure we have same
143 * address even at second ld pass when generating System.map */ 155 * address even at second ld pass when generating System.map */
144#define SCHED_TEXT \ 156#define SCHED_TEXT \
diff --git a/include/linux/init.h b/include/linux/init.h
index e007ae4dc41e..56ec4c62eee0 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -45,6 +45,19 @@
45#define __exitdata __attribute__ ((__section__(".exit.data"))) 45#define __exitdata __attribute__ ((__section__(".exit.data")))
46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) 46#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
47 47
48/* modpost check for section mismatches during the kernel build.
49 * A section mismatch happens when there are references from a
50 * code or data section to an init section (both code or data).
51 * The init sections are (for most archs) discarded by the kernel
52 * when early init has completed so all such references are potential bugs.
53 * For exit sections the same issue exists.
54 * The following markers are used for the cases where the reference to
55 * the init/exit section (code or data) is valid and will teach modpost
56 * not to issue a warning.
57 * The markers follow same syntax rules as __init / __initdata. */
58#define __init_refok noinline __attribute__ ((__section__ (".text.init.refok")))
59#define __initdata_refok __attribute__ ((__section__ (".data.init.refok")))
60
48#ifdef MODULE 61#ifdef MODULE
49#define __exit __attribute__ ((__section__(".exit.text"))) 62#define __exit __attribute__ ((__section__(".exit.text")))
50#else 63#else