summaryrefslogtreecommitdiff
path: root/include/lib/libc/cdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lib/libc/cdefs.h')
-rw-r--r--include/lib/libc/cdefs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/lib/libc/cdefs.h b/include/lib/libc/cdefs.h
index b1d10ccc..0d007225 100644
--- a/include/lib/libc/cdefs.h
+++ b/include/lib/libc/cdefs.h
@@ -14,6 +14,15 @@
#define __unused __attribute__((__unused__))
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
+#if RECLAIM_INIT_CODE
+/*
+ * Add each function to a section that is unique so the functions can still
+ * be garbage collected
+ */
+#define __init __section(".text.init." __FILE__ "." __XSTRING(__LINE__))
+#else
+#define __init
+#endif
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))