summaryrefslogtreecommitdiff
path: root/kern/init.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-07 20:59:07 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-07 21:51:32 +0200
commit44d0759b9a2d6cf715cc45442ad096d5bd8d9fa4 (patch)
treed8a728daf6a4227da8df1b2410decbe45074d5ca /kern/init.h
parent2ab04b9af9dbc565192dc63b88ed0fd1a42d2082 (diff)
kern/init: fix LTO builds
Initialization operations are never directly referenced, as they're retrieved by accessing the .init.ops subsection. As a result, whole program optimizations as applied during link time optimizations cause the structures and most of the related code not to be compiled in. Use the recently added __used attribute macro to fix this issue.
Diffstat (limited to 'kern/init.h')
-rw-r--r--kern/init.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kern/init.h b/kern/init.h
index 8f1cacf8..7c3522e8 100644
--- a/kern/init.h
+++ b/kern/init.h
@@ -90,7 +90,7 @@ typedef int (*init_op_fn_t)(void);
__VA_ARGS__ \
}; \
\
- struct init_op INIT_OP(_fn) __initop = { \
+ struct init_op INIT_OP(_fn) __initop __used = { \
.name = QUOTE(_fn), \
.fn = _fn, \
.deps = INIT_OP_DEPS(_fn), \