summaryrefslogtreecommitdiff
path: root/arch/um
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2019-08-23 15:36:50 +0200
committerRichard Weinberger <richard@nod.at>2019-09-15 21:37:13 +0200
commit786b2384bf1c1b53dc23dc493aaaae29ef01e6ce (patch)
treeda587d75161c565cf98e9b3acfaf0b0a99898408 /arch/um
parent324f80cc3ee5b748735ba46288d4b2e0eb844ed7 (diff)
downloadlwn-786b2384bf1c1b53dc23dc493aaaae29ef01e6ce.tar.gz
lwn-786b2384bf1c1b53dc23dc493aaaae29ef01e6ce.zip
um: Enable CONFIG_CONSTRUCTORS
We do need to call the constructors for *modules*, and at least for KASAN in the future, we must call even the kernel constructors only later when the kernel has been initialized. Instead of relying on libc to call them, emit an empty section for libc and let the kernel's CONSTRUCTORS code do the rest of the job. Tested that it indeed doesn't work in modules, and does work after the fixes in both, with a few functions with __attribute__((constructor)) in both dynamic and static builds. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/include/asm/common.lds.S2
-rw-r--r--arch/um/kernel/dyn.lds.S1
2 files changed, 1 insertions, 2 deletions
diff --git a/arch/um/include/asm/common.lds.S b/arch/um/include/asm/common.lds.S
index 4049f2c46387..d7086b985f27 100644
--- a/arch/um/include/asm/common.lds.S
+++ b/arch/um/include/asm/common.lds.S
@@ -83,8 +83,8 @@
__preinit_array_end = .;
}
.init_array : {
+ /* dummy - we call this ourselves */
__init_array_start = .;
- *(.init_array)
__init_array_end = .;
}
.fini_array : {
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index f5001481010c..c69d69ee96be 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -103,7 +103,6 @@ SECTIONS
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
.preinit_array : { *(.preinit_array) }
- .init_array : { *(.init_array) }
.fini_array : { *(.fini_array) }
.data : {
INIT_TASK_DATA(KERNEL_STACK_SIZE)