summaryrefslogtreecommitdiff
path: root/include/asm-generic/vmlinux.lds.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/vmlinux.lds.h')
-rw-r--r--include/asm-generic/vmlinux.lds.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6bdba10fef4a..55413e568f07 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -440,12 +440,21 @@
INIT_TASK \
}
+#ifdef CONFIG_CONSTRUCTORS
+#define KERNEL_CTORS() VMLINUX_SYMBOL(__ctors_start) = .; \
+ *(.ctors) \
+ VMLINUX_SYMBOL(__ctors_end) = .;
+#else
+#define KERNEL_CTORS()
+#endif
+
/* init and exit section handling */
#define INIT_DATA \
*(.init.data) \
DEV_DISCARD(init.data) \
CPU_DISCARD(init.data) \
MEM_DISCARD(init.data) \
+ KERNEL_CTORS() \
*(.init.rodata) \
DEV_DISCARD(init.rodata) \
CPU_DISCARD(init.rodata) \