Revision
23322
Author
zarzycki@apple.com
Date
2007-07-30 10:43:00 -0700 (Mon, 30 Jul 2007)

Log Message

Force dyld to resolve certain symbols at launch rather than lazily.

Modified Paths

Diff

Modified: trunk/launchd/src/launchd.c (23321 => 23322)


--- trunk/launchd/src/launchd.c	2007-07-30 15:15:12 UTC (rev 23321)
+++ trunk/launchd/src/launchd.c	2007-07-30 17:43:00 UTC (rev 23322)
@@ -179,6 +179,11 @@
 
 #define PID1_CRASH_LOGFILE "/var/log/launchd-pid1.crash"
 
+/* This hack forces the dynamic linker to resolve these symbols ASAP */
+static __attribute__((unused)) typeof(sync) *__junk_dyld_trick1 = sync;
+static __attribute__((unused)) typeof(sleep) *__junk_dyld_trick2 = sleep;
+static __attribute__((unused)) typeof(reboot) *__junk_dyld_trick3 = reboot;
+
 void
 fatal_signal_handler(int sig, siginfo_t *si, void *uap)
 {