PageRenderTime 50ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 1ms

/ghc-7.0.4/rts/Linker.c

http://picorec.googlecode.com/
C | 1526 lines | 1199 code | 117 blank | 210 comment | 94 complexity | a6888914a5d23ce40b8b99dfcf181f56 MD5 | raw file
Possible License(s): BSD-3-Clause, BSD-2-Clause

Large files files are truncated, but you can click here to view the full file

  1. /* -----------------------------------------------------------------------------
  2. *
  3. * (c) The GHC Team, 2000-2004
  4. *
  5. * RTS Object Linker
  6. *
  7. * ---------------------------------------------------------------------------*/
  8. #if 0
  9. #include "PosixSource.h"
  10. #endif
  11. /* Linux needs _GNU_SOURCE to get RTLD_DEFAULT from <dlfcn.h> and
  12. MREMAP_MAYMOVE from <sys/mman.h>.
  13. */
  14. #ifdef __linux__
  15. #define _GNU_SOURCE
  16. #endif
  17. #include "Rts.h"
  18. #include "HsFFI.h"
  19. #include "sm/Storage.h"
  20. #include "Stats.h"
  21. #include "Hash.h"
  22. #include "LinkerInternals.h"
  23. #include "RtsUtils.h"
  24. #include "Trace.h"
  25. #include "StgPrimFloat.h" // for __int_encodeFloat etc.
  26. #include "Stable.h"
  27. #if !defined(mingw32_HOST_OS)
  28. #include "posix/Signals.h"
  29. #endif
  30. // get protos for is*()
  31. #include <ctype.h>
  32. #ifdef HAVE_SYS_TYPES_H
  33. #include <sys/types.h>
  34. #endif
  35. #include <inttypes.h>
  36. #include <stdlib.h>
  37. #include <string.h>
  38. #include <stdio.h>
  39. #include <assert.h>
  40. #ifdef HAVE_SYS_STAT_H
  41. #include <sys/stat.h>
  42. #endif
  43. #if defined(HAVE_DLFCN_H)
  44. #include <dlfcn.h>
  45. #endif
  46. #if defined(cygwin32_HOST_OS)
  47. #ifdef HAVE_DIRENT_H
  48. #include <dirent.h>
  49. #endif
  50. #ifdef HAVE_SYS_TIME_H
  51. #include <sys/time.h>
  52. #endif
  53. #include <regex.h>
  54. #include <sys/fcntl.h>
  55. #include <sys/termios.h>
  56. #include <sys/utime.h>
  57. #include <sys/utsname.h>
  58. #include <sys/wait.h>
  59. #endif
  60. #if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \
  61. defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \
  62. defined(openbsd_HOST_OS ) || \
  63. ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) )
  64. /* Don't use mmap on powerpc-apple-darwin as mmap doesn't support
  65. * reallocating but we need to allocate jump islands just after each
  66. * object images. Otherwise relative branches to jump islands can fail
  67. * due to 24-bits displacement overflow.
  68. */
  69. #define USE_MMAP
  70. #include <fcntl.h>
  71. #include <sys/mman.h>
  72. #ifdef HAVE_UNISTD_H
  73. #include <unistd.h>
  74. #endif
  75. #endif
  76. #if defined(linux_HOST_OS) || defined(solaris2_HOST_OS) || defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS) || defined(openbsd_HOST_OS)
  77. # define OBJFORMAT_ELF
  78. # include <regex.h> // regex is already used by dlopen() so this is OK
  79. // to use here without requiring an additional lib
  80. #elif defined(cygwin32_HOST_OS) || defined (mingw32_HOST_OS)
  81. # define OBJFORMAT_PEi386
  82. # include <windows.h>
  83. # include <math.h>
  84. #elif defined(darwin_HOST_OS)
  85. # define OBJFORMAT_MACHO
  86. # include <regex.h>
  87. # include <mach-o/loader.h>
  88. # include <mach-o/nlist.h>
  89. # include <mach-o/reloc.h>
  90. #if !defined(HAVE_DLFCN_H)
  91. # include <mach-o/dyld.h>
  92. #endif
  93. #if defined(powerpc_HOST_ARCH)
  94. # include <mach-o/ppc/reloc.h>
  95. #endif
  96. #if defined(x86_64_HOST_ARCH)
  97. # include <mach-o/x86_64/reloc.h>
  98. #endif
  99. #endif
  100. #if defined(x86_64_HOST_ARCH) && defined(darwin_HOST_OS)
  101. #define ALWAYS_PIC
  102. #endif
  103. /* Hash table mapping symbol names to Symbol */
  104. static /*Str*/HashTable *symhash;
  105. /* Hash table mapping symbol names to StgStablePtr */
  106. static /*Str*/HashTable *stablehash;
  107. /* List of currently loaded objects */
  108. ObjectCode *objects = NULL; /* initially empty */
  109. static HsInt loadOc( ObjectCode* oc );
  110. static ObjectCode* mkOc( char *path, char *image, int imageSize,
  111. char *archiveMemberName
  112. #ifndef USE_MMAP
  113. #ifdef darwin_HOST_OS
  114. , int misalignment
  115. #endif
  116. #endif
  117. );
  118. #if defined(OBJFORMAT_ELF)
  119. static int ocVerifyImage_ELF ( ObjectCode* oc );
  120. static int ocGetNames_ELF ( ObjectCode* oc );
  121. static int ocResolve_ELF ( ObjectCode* oc );
  122. #if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
  123. static int ocAllocateSymbolExtras_ELF ( ObjectCode* oc );
  124. #endif
  125. #elif defined(OBJFORMAT_PEi386)
  126. static int ocVerifyImage_PEi386 ( ObjectCode* oc );
  127. static int ocGetNames_PEi386 ( ObjectCode* oc );
  128. static int ocResolve_PEi386 ( ObjectCode* oc );
  129. static void *lookupSymbolInDLLs ( unsigned char *lbl );
  130. static void zapTrailingAtSign ( unsigned char *sym );
  131. #elif defined(OBJFORMAT_MACHO)
  132. static int ocVerifyImage_MachO ( ObjectCode* oc );
  133. static int ocGetNames_MachO ( ObjectCode* oc );
  134. static int ocResolve_MachO ( ObjectCode* oc );
  135. #ifndef USE_MMAP
  136. static int machoGetMisalignment( FILE * );
  137. #endif
  138. #if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
  139. static int ocAllocateSymbolExtras_MachO ( ObjectCode* oc );
  140. #endif
  141. #ifdef powerpc_HOST_ARCH
  142. static void machoInitSymbolsWithoutUnderscore( void );
  143. #endif
  144. #endif
  145. /* on x86_64 we have a problem with relocating symbol references in
  146. * code that was compiled without -fPIC. By default, the small memory
  147. * model is used, which assumes that symbol references can fit in a
  148. * 32-bit slot. The system dynamic linker makes this work for
  149. * references to shared libraries by either (a) allocating a jump
  150. * table slot for code references, or (b) moving the symbol at load
  151. * time (and copying its contents, if necessary) for data references.
  152. *
  153. * We unfortunately can't tell whether symbol references are to code
  154. * or data. So for now we assume they are code (the vast majority
  155. * are), and allocate jump-table slots. Unfortunately this will
  156. * SILENTLY generate crashing code for data references. This hack is
  157. * enabled by X86_64_ELF_NONPIC_HACK.
  158. *
  159. * One workaround is to use shared Haskell libraries. This is
  160. * coming. Another workaround is to keep the static libraries but
  161. * compile them with -fPIC, because that will generate PIC references
  162. * to data which can be relocated. The PIC code is still too green to
  163. * do this systematically, though.
  164. *
  165. * See bug #781
  166. * See thread http://www.haskell.org/pipermail/cvs-ghc/2007-September/038458.html
  167. *
  168. * Naming Scheme for Symbol Macros
  169. *
  170. * SymI_*: symbol is internal to the RTS. It resides in an object
  171. * file/library that is statically.
  172. * SymE_*: symbol is external to the RTS library. It might be linked
  173. * dynamically.
  174. *
  175. * Sym*_HasProto : the symbol prototype is imported in an include file
  176. * or defined explicitly
  177. * Sym*_NeedsProto: the symbol is undefined and we add a dummy
  178. * default proto extern void sym(void);
  179. */
  180. #define X86_64_ELF_NONPIC_HACK 1
  181. /* Link objects into the lower 2Gb on x86_64. GHC assumes the
  182. * small memory model on this architecture (see gcc docs,
  183. * -mcmodel=small).
  184. *
  185. * MAP_32BIT not available on OpenBSD/amd64
  186. */
  187. #if defined(x86_64_HOST_ARCH) && defined(MAP_32BIT)
  188. #define TRY_MAP_32BIT MAP_32BIT
  189. #else
  190. #define TRY_MAP_32BIT 0
  191. #endif
  192. /*
  193. * Due to the small memory model (see above), on x86_64 we have to map
  194. * all our non-PIC object files into the low 2Gb of the address space
  195. * (why 2Gb and not 4Gb? Because all addresses must be reachable
  196. * using a 32-bit signed PC-relative offset). On Linux we can do this
  197. * using the MAP_32BIT flag to mmap(), however on other OSs
  198. * (e.g. *BSD, see #2063, and also on Linux inside Xen, see #2512), we
  199. * can't do this. So on these systems, we have to pick a base address
  200. * in the low 2Gb of the address space and try to allocate memory from
  201. * there.
  202. *
  203. * We pick a default address based on the OS, but also make this
  204. * configurable via an RTS flag (+RTS -xm)
  205. */
  206. #if !defined(ALWAYS_PIC) && defined(x86_64_HOST_ARCH)
  207. #if defined(MAP_32BIT)
  208. // Try to use MAP_32BIT
  209. #define MMAP_32BIT_BASE_DEFAULT 0
  210. #else
  211. // A guess: 1Gb.
  212. #define MMAP_32BIT_BASE_DEFAULT 0x40000000
  213. #endif
  214. static void *mmap_32bit_base = (void *)MMAP_32BIT_BASE_DEFAULT;
  215. #endif
  216. /* MAP_ANONYMOUS is MAP_ANON on some systems, e.g. OpenBSD */
  217. #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
  218. #define MAP_ANONYMOUS MAP_ANON
  219. #endif
  220. /* -----------------------------------------------------------------------------
  221. * Built-in symbols from the RTS
  222. */
  223. typedef struct _RtsSymbolVal {
  224. char *lbl;
  225. void *addr;
  226. } RtsSymbolVal;
  227. #define Maybe_Stable_Names SymI_HasProto(stg_mkWeakzh) \
  228. SymI_HasProto(stg_mkWeakForeignEnvzh) \
  229. SymI_HasProto(stg_makeStableNamezh) \
  230. SymI_HasProto(stg_finalizzeWeakzh)
  231. #if !defined (mingw32_HOST_OS)
  232. #define RTS_POSIX_ONLY_SYMBOLS \
  233. SymI_HasProto(__hscore_get_saved_termios) \
  234. SymI_HasProto(__hscore_set_saved_termios) \
  235. SymI_HasProto(shutdownHaskellAndSignal) \
  236. SymI_HasProto(lockFile) \
  237. SymI_HasProto(unlockFile) \
  238. SymI_HasProto(signal_handlers) \
  239. SymI_HasProto(stg_sig_install) \
  240. SymI_HasProto(rtsTimerSignal) \
  241. SymI_NeedsProto(nocldstop)
  242. #endif
  243. #if defined (cygwin32_HOST_OS)
  244. #define RTS_MINGW_ONLY_SYMBOLS /**/
  245. /* Don't have the ability to read import libs / archives, so
  246. * we have to stupidly list a lot of what libcygwin.a
  247. * exports; sigh.
  248. */
  249. #define RTS_CYGWIN_ONLY_SYMBOLS \
  250. SymI_HasProto(regfree) \
  251. SymI_HasProto(regexec) \
  252. SymI_HasProto(regerror) \
  253. SymI_HasProto(regcomp) \
  254. SymI_HasProto(__errno) \
  255. SymI_HasProto(access) \
  256. SymI_HasProto(chmod) \
  257. SymI_HasProto(chdir) \
  258. SymI_HasProto(close) \
  259. SymI_HasProto(creat) \
  260. SymI_HasProto(dup) \
  261. SymI_HasProto(dup2) \
  262. SymI_HasProto(fstat) \
  263. SymI_HasProto(fcntl) \
  264. SymI_HasProto(getcwd) \
  265. SymI_HasProto(getenv) \
  266. SymI_HasProto(lseek) \
  267. SymI_HasProto(open) \
  268. SymI_HasProto(fpathconf) \
  269. SymI_HasProto(pathconf) \
  270. SymI_HasProto(stat) \
  271. SymI_HasProto(pow) \
  272. SymI_HasProto(tanh) \
  273. SymI_HasProto(cosh) \
  274. SymI_HasProto(sinh) \
  275. SymI_HasProto(atan) \
  276. SymI_HasProto(acos) \
  277. SymI_HasProto(asin) \
  278. SymI_HasProto(tan) \
  279. SymI_HasProto(cos) \
  280. SymI_HasProto(sin) \
  281. SymI_HasProto(exp) \
  282. SymI_HasProto(log) \
  283. SymI_HasProto(sqrt) \
  284. SymI_HasProto(localtime_r) \
  285. SymI_HasProto(gmtime_r) \
  286. SymI_HasProto(mktime) \
  287. SymI_NeedsProto(_imp___tzname) \
  288. SymI_HasProto(gettimeofday) \
  289. SymI_HasProto(timezone) \
  290. SymI_HasProto(tcgetattr) \
  291. SymI_HasProto(tcsetattr) \
  292. SymI_HasProto(memcpy) \
  293. SymI_HasProto(memmove) \
  294. SymI_HasProto(realloc) \
  295. SymI_HasProto(malloc) \
  296. SymI_HasProto(free) \
  297. SymI_HasProto(fork) \
  298. SymI_HasProto(lstat) \
  299. SymI_HasProto(isatty) \
  300. SymI_HasProto(mkdir) \
  301. SymI_HasProto(opendir) \
  302. SymI_HasProto(readdir) \
  303. SymI_HasProto(rewinddir) \
  304. SymI_HasProto(closedir) \
  305. SymI_HasProto(link) \
  306. SymI_HasProto(mkfifo) \
  307. SymI_HasProto(pipe) \
  308. SymI_HasProto(read) \
  309. SymI_HasProto(rename) \
  310. SymI_HasProto(rmdir) \
  311. SymI_HasProto(select) \
  312. SymI_HasProto(system) \
  313. SymI_HasProto(write) \
  314. SymI_HasProto(strcmp) \
  315. SymI_HasProto(strcpy) \
  316. SymI_HasProto(strncpy) \
  317. SymI_HasProto(strerror) \
  318. SymI_HasProto(sigaddset) \
  319. SymI_HasProto(sigemptyset) \
  320. SymI_HasProto(sigprocmask) \
  321. SymI_HasProto(umask) \
  322. SymI_HasProto(uname) \
  323. SymI_HasProto(unlink) \
  324. SymI_HasProto(utime) \
  325. SymI_HasProto(waitpid)
  326. #elif !defined(mingw32_HOST_OS)
  327. #define RTS_MINGW_ONLY_SYMBOLS /**/
  328. #define RTS_CYGWIN_ONLY_SYMBOLS /**/
  329. #else /* defined(mingw32_HOST_OS) */
  330. #define RTS_POSIX_ONLY_SYMBOLS /**/
  331. #define RTS_CYGWIN_ONLY_SYMBOLS /**/
  332. #if HAVE_GETTIMEOFDAY
  333. #define RTS_MINGW_GETTIMEOFDAY_SYM SymI_NeedsProto(gettimeofday)
  334. #else
  335. #define RTS_MINGW_GETTIMEOFDAY_SYM /**/
  336. #endif
  337. #if HAVE___MINGW_VFPRINTF
  338. #define RTS___MINGW_VFPRINTF_SYM SymI_HasProto(__mingw_vfprintf)
  339. #else
  340. #define RTS___MINGW_VFPRINTF_SYM /**/
  341. #endif
  342. /* These are statically linked from the mingw libraries into the ghc
  343. executable, so we have to employ this hack. */
  344. #define RTS_MINGW_ONLY_SYMBOLS \
  345. SymI_HasProto(stg_asyncReadzh) \
  346. SymI_HasProto(stg_asyncWritezh) \
  347. SymI_HasProto(stg_asyncDoProczh) \
  348. SymI_HasProto(memset) \
  349. SymI_HasProto(inet_ntoa) \
  350. SymI_HasProto(inet_addr) \
  351. SymI_HasProto(htonl) \
  352. SymI_HasProto(recvfrom) \
  353. SymI_HasProto(listen) \
  354. SymI_HasProto(bind) \
  355. SymI_HasProto(shutdown) \
  356. SymI_HasProto(connect) \
  357. SymI_HasProto(htons) \
  358. SymI_HasProto(ntohs) \
  359. SymI_HasProto(getservbyname) \
  360. SymI_HasProto(getservbyport) \
  361. SymI_HasProto(getprotobynumber) \
  362. SymI_HasProto(getprotobyname) \
  363. SymI_HasProto(gethostbyname) \
  364. SymI_HasProto(gethostbyaddr) \
  365. SymI_HasProto(gethostname) \
  366. SymI_HasProto(strcpy) \
  367. SymI_HasProto(strncpy) \
  368. SymI_HasProto(abort) \
  369. SymI_NeedsProto(_alloca) \
  370. SymI_HasProto(isxdigit) \
  371. SymI_HasProto(isupper) \
  372. SymI_HasProto(ispunct) \
  373. SymI_HasProto(islower) \
  374. SymI_HasProto(isspace) \
  375. SymI_HasProto(isprint) \
  376. SymI_HasProto(isdigit) \
  377. SymI_HasProto(iscntrl) \
  378. SymI_HasProto(isalpha) \
  379. SymI_HasProto(isalnum) \
  380. SymI_HasProto(isascii) \
  381. RTS___MINGW_VFPRINTF_SYM \
  382. SymI_HasProto(strcmp) \
  383. SymI_HasProto(memmove) \
  384. SymI_HasProto(realloc) \
  385. SymI_HasProto(malloc) \
  386. SymI_HasProto(pow) \
  387. SymI_HasProto(tanh) \
  388. SymI_HasProto(cosh) \
  389. SymI_HasProto(sinh) \
  390. SymI_HasProto(atan) \
  391. SymI_HasProto(acos) \
  392. SymI_HasProto(asin) \
  393. SymI_HasProto(tan) \
  394. SymI_HasProto(cos) \
  395. SymI_HasProto(sin) \
  396. SymI_HasProto(exp) \
  397. SymI_HasProto(log) \
  398. SymI_HasProto(sqrt) \
  399. SymI_HasProto(powf) \
  400. SymI_HasProto(tanhf) \
  401. SymI_HasProto(coshf) \
  402. SymI_HasProto(sinhf) \
  403. SymI_HasProto(atanf) \
  404. SymI_HasProto(acosf) \
  405. SymI_HasProto(asinf) \
  406. SymI_HasProto(tanf) \
  407. SymI_HasProto(cosf) \
  408. SymI_HasProto(sinf) \
  409. SymI_HasProto(expf) \
  410. SymI_HasProto(logf) \
  411. SymI_HasProto(sqrtf) \
  412. SymI_HasProto(erf) \
  413. SymI_HasProto(erfc) \
  414. SymI_HasProto(erff) \
  415. SymI_HasProto(erfcf) \
  416. SymI_HasProto(memcpy) \
  417. SymI_HasProto(rts_InstallConsoleEvent) \
  418. SymI_HasProto(rts_ConsoleHandlerDone) \
  419. SymI_NeedsProto(mktime) \
  420. SymI_NeedsProto(_imp___timezone) \
  421. SymI_NeedsProto(_imp___tzname) \
  422. SymI_NeedsProto(_imp__tzname) \
  423. SymI_NeedsProto(_imp___iob) \
  424. SymI_NeedsProto(_imp___osver) \
  425. SymI_NeedsProto(localtime) \
  426. SymI_NeedsProto(gmtime) \
  427. SymI_NeedsProto(opendir) \
  428. SymI_NeedsProto(readdir) \
  429. SymI_NeedsProto(rewinddir) \
  430. SymI_NeedsProto(_imp____mb_cur_max) \
  431. SymI_NeedsProto(_imp___pctype) \
  432. SymI_NeedsProto(__chkstk) \
  433. RTS_MINGW_GETTIMEOFDAY_SYM \
  434. SymI_NeedsProto(closedir)
  435. #endif
  436. #if defined(darwin_HOST_OS) && HAVE_PRINTF_LDBLSTUB
  437. #define RTS_DARWIN_ONLY_SYMBOLS \
  438. SymI_NeedsProto(asprintf$LDBLStub) \
  439. SymI_NeedsProto(err$LDBLStub) \
  440. SymI_NeedsProto(errc$LDBLStub) \
  441. SymI_NeedsProto(errx$LDBLStub) \
  442. SymI_NeedsProto(fprintf$LDBLStub) \
  443. SymI_NeedsProto(fscanf$LDBLStub) \
  444. SymI_NeedsProto(fwprintf$LDBLStub) \
  445. SymI_NeedsProto(fwscanf$LDBLStub) \
  446. SymI_NeedsProto(printf$LDBLStub) \
  447. SymI_NeedsProto(scanf$LDBLStub) \
  448. SymI_NeedsProto(snprintf$LDBLStub) \
  449. SymI_NeedsProto(sprintf$LDBLStub) \
  450. SymI_NeedsProto(sscanf$LDBLStub) \
  451. SymI_NeedsProto(strtold$LDBLStub) \
  452. SymI_NeedsProto(swprintf$LDBLStub) \
  453. SymI_NeedsProto(swscanf$LDBLStub) \
  454. SymI_NeedsProto(syslog$LDBLStub) \
  455. SymI_NeedsProto(vasprintf$LDBLStub) \
  456. SymI_NeedsProto(verr$LDBLStub) \
  457. SymI_NeedsProto(verrc$LDBLStub) \
  458. SymI_NeedsProto(verrx$LDBLStub) \
  459. SymI_NeedsProto(vfprintf$LDBLStub) \
  460. SymI_NeedsProto(vfscanf$LDBLStub) \
  461. SymI_NeedsProto(vfwprintf$LDBLStub) \
  462. SymI_NeedsProto(vfwscanf$LDBLStub) \
  463. SymI_NeedsProto(vprintf$LDBLStub) \
  464. SymI_NeedsProto(vscanf$LDBLStub) \
  465. SymI_NeedsProto(vsnprintf$LDBLStub) \
  466. SymI_NeedsProto(vsprintf$LDBLStub) \
  467. SymI_NeedsProto(vsscanf$LDBLStub) \
  468. SymI_NeedsProto(vswprintf$LDBLStub) \
  469. SymI_NeedsProto(vswscanf$LDBLStub) \
  470. SymI_NeedsProto(vsyslog$LDBLStub) \
  471. SymI_NeedsProto(vwarn$LDBLStub) \
  472. SymI_NeedsProto(vwarnc$LDBLStub) \
  473. SymI_NeedsProto(vwarnx$LDBLStub) \
  474. SymI_NeedsProto(vwprintf$LDBLStub) \
  475. SymI_NeedsProto(vwscanf$LDBLStub) \
  476. SymI_NeedsProto(warn$LDBLStub) \
  477. SymI_NeedsProto(warnc$LDBLStub) \
  478. SymI_NeedsProto(warnx$LDBLStub) \
  479. SymI_NeedsProto(wcstold$LDBLStub) \
  480. SymI_NeedsProto(wprintf$LDBLStub) \
  481. SymI_NeedsProto(wscanf$LDBLStub)
  482. #else
  483. #define RTS_DARWIN_ONLY_SYMBOLS
  484. #endif
  485. #ifndef SMP
  486. # define MAIN_CAP_SYM SymI_HasProto(MainCapability)
  487. #else
  488. # define MAIN_CAP_SYM
  489. #endif
  490. #if !defined(mingw32_HOST_OS)
  491. #define RTS_USER_SIGNALS_SYMBOLS \
  492. SymI_HasProto(setIOManagerControlFd) \
  493. SymI_HasProto(setIOManagerWakeupFd) \
  494. SymI_HasProto(ioManagerWakeup) \
  495. SymI_HasProto(blockUserSignals) \
  496. SymI_HasProto(unblockUserSignals)
  497. #else
  498. #define RTS_USER_SIGNALS_SYMBOLS \
  499. SymI_HasProto(ioManagerWakeup) \
  500. SymI_HasProto(sendIOManagerEvent) \
  501. SymI_HasProto(readIOManagerEvent) \
  502. SymI_HasProto(getIOManagerEvent) \
  503. SymI_HasProto(console_handler)
  504. #endif
  505. #define RTS_LIBFFI_SYMBOLS \
  506. SymE_NeedsProto(ffi_prep_cif) \
  507. SymE_NeedsProto(ffi_call) \
  508. SymE_NeedsProto(ffi_type_void) \
  509. SymE_NeedsProto(ffi_type_float) \
  510. SymE_NeedsProto(ffi_type_double) \
  511. SymE_NeedsProto(ffi_type_sint64) \
  512. SymE_NeedsProto(ffi_type_uint64) \
  513. SymE_NeedsProto(ffi_type_sint32) \
  514. SymE_NeedsProto(ffi_type_uint32) \
  515. SymE_NeedsProto(ffi_type_sint16) \
  516. SymE_NeedsProto(ffi_type_uint16) \
  517. SymE_NeedsProto(ffi_type_sint8) \
  518. SymE_NeedsProto(ffi_type_uint8) \
  519. SymE_NeedsProto(ffi_type_pointer)
  520. #ifdef TABLES_NEXT_TO_CODE
  521. #define RTS_RET_SYMBOLS /* nothing */
  522. #else
  523. #define RTS_RET_SYMBOLS \
  524. SymI_HasProto(stg_enter_ret) \
  525. SymI_HasProto(stg_gc_fun_ret) \
  526. SymI_HasProto(stg_ap_v_ret) \
  527. SymI_HasProto(stg_ap_f_ret) \
  528. SymI_HasProto(stg_ap_d_ret) \
  529. SymI_HasProto(stg_ap_l_ret) \
  530. SymI_HasProto(stg_ap_n_ret) \
  531. SymI_HasProto(stg_ap_p_ret) \
  532. SymI_HasProto(stg_ap_pv_ret) \
  533. SymI_HasProto(stg_ap_pp_ret) \
  534. SymI_HasProto(stg_ap_ppv_ret) \
  535. SymI_HasProto(stg_ap_ppp_ret) \
  536. SymI_HasProto(stg_ap_pppv_ret) \
  537. SymI_HasProto(stg_ap_pppp_ret) \
  538. SymI_HasProto(stg_ap_ppppp_ret) \
  539. SymI_HasProto(stg_ap_pppppp_ret)
  540. #endif
  541. /* Modules compiled with -ticky may mention ticky counters */
  542. /* This list should marry up with the one in $(TOP)/includes/stg/Ticky.h */
  543. #define RTS_TICKY_SYMBOLS \
  544. SymI_NeedsProto(ticky_entry_ctrs) \
  545. SymI_NeedsProto(top_ct) \
  546. \
  547. SymI_HasProto(ENT_VIA_NODE_ctr) \
  548. SymI_HasProto(ENT_STATIC_THK_ctr) \
  549. SymI_HasProto(ENT_DYN_THK_ctr) \
  550. SymI_HasProto(ENT_STATIC_FUN_DIRECT_ctr) \
  551. SymI_HasProto(ENT_DYN_FUN_DIRECT_ctr) \
  552. SymI_HasProto(ENT_STATIC_CON_ctr) \
  553. SymI_HasProto(ENT_DYN_CON_ctr) \
  554. SymI_HasProto(ENT_STATIC_IND_ctr) \
  555. SymI_HasProto(ENT_DYN_IND_ctr) \
  556. SymI_HasProto(ENT_PERM_IND_ctr) \
  557. SymI_HasProto(ENT_PAP_ctr) \
  558. SymI_HasProto(ENT_AP_ctr) \
  559. SymI_HasProto(ENT_AP_STACK_ctr) \
  560. SymI_HasProto(ENT_BH_ctr) \
  561. SymI_HasProto(UNKNOWN_CALL_ctr) \
  562. SymI_HasProto(SLOW_CALL_v_ctr) \
  563. SymI_HasProto(SLOW_CALL_f_ctr) \
  564. SymI_HasProto(SLOW_CALL_d_ctr) \
  565. SymI_HasProto(SLOW_CALL_l_ctr) \
  566. SymI_HasProto(SLOW_CALL_n_ctr) \
  567. SymI_HasProto(SLOW_CALL_p_ctr) \
  568. SymI_HasProto(SLOW_CALL_pv_ctr) \
  569. SymI_HasProto(SLOW_CALL_pp_ctr) \
  570. SymI_HasProto(SLOW_CALL_ppv_ctr) \
  571. SymI_HasProto(SLOW_CALL_ppp_ctr) \
  572. SymI_HasProto(SLOW_CALL_pppv_ctr) \
  573. SymI_HasProto(SLOW_CALL_pppp_ctr) \
  574. SymI_HasProto(SLOW_CALL_ppppp_ctr) \
  575. SymI_HasProto(SLOW_CALL_pppppp_ctr) \
  576. SymI_HasProto(SLOW_CALL_OTHER_ctr) \
  577. SymI_HasProto(ticky_slow_call_unevald) \
  578. SymI_HasProto(SLOW_CALL_ctr) \
  579. SymI_HasProto(MULTI_CHUNK_SLOW_CALL_ctr) \
  580. SymI_HasProto(MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr) \
  581. SymI_HasProto(KNOWN_CALL_ctr) \
  582. SymI_HasProto(KNOWN_CALL_TOO_FEW_ARGS_ctr) \
  583. SymI_HasProto(KNOWN_CALL_EXTRA_ARGS_ctr) \
  584. SymI_HasProto(SLOW_CALL_FUN_TOO_FEW_ctr) \
  585. SymI_HasProto(SLOW_CALL_FUN_CORRECT_ctr) \
  586. SymI_HasProto(SLOW_CALL_FUN_TOO_MANY_ctr) \
  587. SymI_HasProto(SLOW_CALL_PAP_TOO_FEW_ctr) \
  588. SymI_HasProto(SLOW_CALL_PAP_CORRECT_ctr) \
  589. SymI_HasProto(SLOW_CALL_PAP_TOO_MANY_ctr) \
  590. SymI_HasProto(SLOW_CALL_UNEVALD_ctr) \
  591. SymI_HasProto(UPDF_OMITTED_ctr) \
  592. SymI_HasProto(UPDF_PUSHED_ctr) \
  593. SymI_HasProto(CATCHF_PUSHED_ctr) \
  594. SymI_HasProto(UPDF_RCC_PUSHED_ctr) \
  595. SymI_HasProto(UPDF_RCC_OMITTED_ctr) \
  596. SymI_HasProto(UPD_SQUEEZED_ctr) \
  597. SymI_HasProto(UPD_CON_IN_NEW_ctr) \
  598. SymI_HasProto(UPD_CON_IN_PLACE_ctr) \
  599. SymI_HasProto(UPD_PAP_IN_NEW_ctr) \
  600. SymI_HasProto(UPD_PAP_IN_PLACE_ctr) \
  601. SymI_HasProto(ALLOC_HEAP_ctr) \
  602. SymI_HasProto(ALLOC_HEAP_tot) \
  603. SymI_HasProto(ALLOC_FUN_ctr) \
  604. SymI_HasProto(ALLOC_FUN_adm) \
  605. SymI_HasProto(ALLOC_FUN_gds) \
  606. SymI_HasProto(ALLOC_FUN_slp) \
  607. SymI_HasProto(UPD_NEW_IND_ctr) \
  608. SymI_HasProto(UPD_NEW_PERM_IND_ctr) \
  609. SymI_HasProto(UPD_OLD_IND_ctr) \
  610. SymI_HasProto(UPD_OLD_PERM_IND_ctr) \
  611. SymI_HasProto(UPD_BH_UPDATABLE_ctr) \
  612. SymI_HasProto(UPD_BH_SINGLE_ENTRY_ctr) \
  613. SymI_HasProto(UPD_CAF_BH_UPDATABLE_ctr) \
  614. SymI_HasProto(UPD_CAF_BH_SINGLE_ENTRY_ctr) \
  615. SymI_HasProto(GC_SEL_ABANDONED_ctr) \
  616. SymI_HasProto(GC_SEL_MINOR_ctr) \
  617. SymI_HasProto(GC_SEL_MAJOR_ctr) \
  618. SymI_HasProto(GC_FAILED_PROMOTION_ctr) \
  619. SymI_HasProto(ALLOC_UP_THK_ctr) \
  620. SymI_HasProto(ALLOC_SE_THK_ctr) \
  621. SymI_HasProto(ALLOC_THK_adm) \
  622. SymI_HasProto(ALLOC_THK_gds) \
  623. SymI_HasProto(ALLOC_THK_slp) \
  624. SymI_HasProto(ALLOC_CON_ctr) \
  625. SymI_HasProto(ALLOC_CON_adm) \
  626. SymI_HasProto(ALLOC_CON_gds) \
  627. SymI_HasProto(ALLOC_CON_slp) \
  628. SymI_HasProto(ALLOC_TUP_ctr) \
  629. SymI_HasProto(ALLOC_TUP_adm) \
  630. SymI_HasProto(ALLOC_TUP_gds) \
  631. SymI_HasProto(ALLOC_TUP_slp) \
  632. SymI_HasProto(ALLOC_BH_ctr) \
  633. SymI_HasProto(ALLOC_BH_adm) \
  634. SymI_HasProto(ALLOC_BH_gds) \
  635. SymI_HasProto(ALLOC_BH_slp) \
  636. SymI_HasProto(ALLOC_PRIM_ctr) \
  637. SymI_HasProto(ALLOC_PRIM_adm) \
  638. SymI_HasProto(ALLOC_PRIM_gds) \
  639. SymI_HasProto(ALLOC_PRIM_slp) \
  640. SymI_HasProto(ALLOC_PAP_ctr) \
  641. SymI_HasProto(ALLOC_PAP_adm) \
  642. SymI_HasProto(ALLOC_PAP_gds) \
  643. SymI_HasProto(ALLOC_PAP_slp) \
  644. SymI_HasProto(ALLOC_TSO_ctr) \
  645. SymI_HasProto(ALLOC_TSO_adm) \
  646. SymI_HasProto(ALLOC_TSO_gds) \
  647. SymI_HasProto(ALLOC_TSO_slp) \
  648. SymI_HasProto(RET_NEW_ctr) \
  649. SymI_HasProto(RET_OLD_ctr) \
  650. SymI_HasProto(RET_UNBOXED_TUP_ctr) \
  651. SymI_HasProto(RET_SEMI_loads_avoided)
  652. // On most platforms, the garbage collector rewrites references
  653. // to small integer and char objects to a set of common, shared ones.
  654. //
  655. // We don't do this when compiling to Windows DLLs at the moment because
  656. // it doesn't support cross package data references well.
  657. //
  658. #if defined(__PIC__) && defined(mingw32_HOST_OS)
  659. #define RTS_INTCHAR_SYMBOLS
  660. #else
  661. #define RTS_INTCHAR_SYMBOLS \
  662. SymI_HasProto(stg_CHARLIKE_closure) \
  663. SymI_HasProto(stg_INTLIKE_closure)
  664. #endif
  665. #define RTS_SYMBOLS \
  666. Maybe_Stable_Names \
  667. RTS_TICKY_SYMBOLS \
  668. SymI_HasProto(StgReturn) \
  669. SymI_HasProto(stg_enter_info) \
  670. SymI_HasProto(stg_gc_void_info) \
  671. SymI_HasProto(__stg_gc_enter_1) \
  672. SymI_HasProto(stg_gc_noregs) \
  673. SymI_HasProto(stg_gc_unpt_r1_info) \
  674. SymI_HasProto(stg_gc_unpt_r1) \
  675. SymI_HasProto(stg_gc_unbx_r1_info) \
  676. SymI_HasProto(stg_gc_unbx_r1) \
  677. SymI_HasProto(stg_gc_f1_info) \
  678. SymI_HasProto(stg_gc_f1) \
  679. SymI_HasProto(stg_gc_d1_info) \
  680. SymI_HasProto(stg_gc_d1) \
  681. SymI_HasProto(stg_gc_l1_info) \
  682. SymI_HasProto(stg_gc_l1) \
  683. SymI_HasProto(__stg_gc_fun) \
  684. SymI_HasProto(stg_gc_fun_info) \
  685. SymI_HasProto(stg_gc_gen) \
  686. SymI_HasProto(stg_gc_gen_info) \
  687. SymI_HasProto(stg_gc_gen_hp) \
  688. SymI_HasProto(stg_gc_ut) \
  689. SymI_HasProto(stg_gen_yield) \
  690. SymI_HasProto(stg_yield_noregs) \
  691. SymI_HasProto(stg_yield_to_interpreter) \
  692. SymI_HasProto(stg_gen_block) \
  693. SymI_HasProto(stg_block_noregs) \
  694. SymI_HasProto(stg_block_1) \
  695. SymI_HasProto(stg_block_takemvar) \
  696. SymI_HasProto(stg_block_putmvar) \
  697. MAIN_CAP_SYM \
  698. SymI_HasProto(MallocFailHook) \
  699. SymI_HasProto(OnExitHook) \
  700. SymI_HasProto(OutOfHeapHook) \
  701. SymI_HasProto(StackOverflowHook) \
  702. SymI_HasProto(addDLL) \
  703. SymI_HasProto(__int_encodeDouble) \
  704. SymI_HasProto(__word_encodeDouble) \
  705. SymI_HasProto(__2Int_encodeDouble) \
  706. SymI_HasProto(__int_encodeFloat) \
  707. SymI_HasProto(__word_encodeFloat) \
  708. SymI_HasProto(stg_atomicallyzh) \
  709. SymI_HasProto(barf) \
  710. SymI_HasProto(debugBelch) \
  711. SymI_HasProto(errorBelch) \
  712. SymI_HasProto(sysErrorBelch) \
  713. SymI_HasProto(stg_getMaskingStatezh) \
  714. SymI_HasProto(stg_maskAsyncExceptionszh) \
  715. SymI_HasProto(stg_maskUninterruptiblezh) \
  716. SymI_HasProto(stg_catchzh) \
  717. SymI_HasProto(stg_catchRetryzh) \
  718. SymI_HasProto(stg_catchSTMzh) \
  719. SymI_HasProto(stg_checkzh) \
  720. SymI_HasProto(closure_flags) \
  721. SymI_HasProto(cmp_thread) \
  722. SymI_HasProto(createAdjustor) \
  723. SymI_HasProto(stg_decodeDoublezu2Intzh) \
  724. SymI_HasProto(stg_decodeFloatzuIntzh) \
  725. SymI_HasProto(defaultsHook) \
  726. SymI_HasProto(stg_delayzh) \
  727. SymI_HasProto(stg_deRefWeakzh) \
  728. SymI_HasProto(stg_deRefStablePtrzh) \
  729. SymI_HasProto(dirty_MUT_VAR) \
  730. SymI_HasProto(stg_forkzh) \
  731. SymI_HasProto(stg_forkOnzh) \
  732. SymI_HasProto(forkProcess) \
  733. SymI_HasProto(forkOS_createThread) \
  734. SymI_HasProto(freeHaskellFunctionPtr) \
  735. SymI_HasProto(getOrSetTypeableStore) \
  736. SymI_HasProto(getOrSetGHCConcSignalSignalHandlerStore) \
  737. SymI_HasProto(getOrSetGHCConcWindowsPendingDelaysStore) \
  738. SymI_HasProto(getOrSetGHCConcWindowsIOManagerThreadStore) \
  739. SymI_HasProto(getOrSetGHCConcWindowsProddingStore) \
  740. SymI_HasProto(getOrSetSystemEventThreadEventManagerStore) \
  741. SymI_HasProto(getOrSetSystemEventThreadIOManagerThreadStore) \
  742. SymI_HasProto(genSymZh) \
  743. SymI_HasProto(genericRaise) \
  744. SymI_HasProto(getProgArgv) \
  745. SymI_HasProto(getFullProgArgv) \
  746. SymI_HasProto(getStablePtr) \
  747. SymI_HasProto(hs_init) \
  748. SymI_HasProto(hs_exit) \
  749. SymI_HasProto(hs_set_argv) \
  750. SymI_HasProto(hs_add_root) \
  751. SymI_HasProto(hs_perform_gc) \
  752. SymI_HasProto(hs_free_stable_ptr) \
  753. SymI_HasProto(hs_free_fun_ptr) \
  754. SymI_HasProto(hs_hpc_rootModule) \
  755. SymI_HasProto(hs_hpc_module) \
  756. SymI_HasProto(initLinker) \
  757. SymI_HasProto(stg_unpackClosurezh) \
  758. SymI_HasProto(stg_getApStackValzh) \
  759. SymI_HasProto(stg_getSparkzh) \
  760. SymI_HasProto(stg_numSparkszh) \
  761. SymI_HasProto(stg_isCurrentThreadBoundzh) \
  762. SymI_HasProto(stg_isEmptyMVarzh) \
  763. SymI_HasProto(stg_killThreadzh) \
  764. SymI_HasProto(loadArchive) \
  765. SymI_HasProto(loadObj) \
  766. SymI_HasProto(insertStableSymbol) \
  767. SymI_HasProto(insertSymbol) \
  768. SymI_HasProto(lookupSymbol) \
  769. SymI_HasProto(stg_makeStablePtrzh) \
  770. SymI_HasProto(stg_mkApUpd0zh) \
  771. SymI_HasProto(stg_myThreadIdzh) \
  772. SymI_HasProto(stg_labelThreadzh) \
  773. SymI_HasProto(stg_newArrayzh) \
  774. SymI_HasProto(stg_newBCOzh) \
  775. SymI_HasProto(stg_newByteArrayzh) \
  776. SymI_HasProto_redirect(newCAF, newDynCAF) \
  777. SymI_HasProto(stg_newMVarzh) \
  778. SymI_HasProto(stg_newMutVarzh) \
  779. SymI_HasProto(stg_newTVarzh) \
  780. SymI_HasProto(stg_noDuplicatezh) \
  781. SymI_HasProto(stg_atomicModifyMutVarzh) \
  782. SymI_HasProto(stg_newPinnedByteArrayzh) \
  783. SymI_HasProto(stg_newAlignedPinnedByteArrayzh) \
  784. SymI_HasProto(newSpark) \
  785. SymI_HasProto(performGC) \
  786. SymI_HasProto(performMajorGC) \
  787. SymI_HasProto(prog_argc) \
  788. SymI_HasProto(prog_argv) \
  789. SymI_HasProto(stg_putMVarzh) \
  790. SymI_HasProto(stg_raisezh) \
  791. SymI_HasProto(stg_raiseIOzh) \
  792. SymI_HasProto(stg_readTVarzh) \
  793. SymI_HasProto(stg_readTVarIOzh) \
  794. SymI_HasProto(resumeThread) \
  795. SymI_HasProto(resolveObjs) \
  796. SymI_HasProto(stg_retryzh) \
  797. SymI_HasProto(rts_apply) \
  798. SymI_HasProto(rts_checkSchedStatus) \
  799. SymI_HasProto(rts_eval) \
  800. SymI_HasProto(rts_evalIO) \
  801. SymI_HasProto(rts_evalLazyIO) \
  802. SymI_HasProto(rts_evalStableIO) \
  803. SymI_HasProto(rts_eval_) \
  804. SymI_HasProto(rts_getBool) \
  805. SymI_HasProto(rts_getChar) \
  806. SymI_HasProto(rts_getDouble) \
  807. SymI_HasProto(rts_getFloat) \
  808. SymI_HasProto(rts_getInt) \
  809. SymI_HasProto(rts_getInt8) \
  810. SymI_HasProto(rts_getInt16) \
  811. SymI_HasProto(rts_getInt32) \
  812. SymI_HasProto(rts_getInt64) \
  813. SymI_HasProto(rts_getPtr) \
  814. SymI_HasProto(rts_getFunPtr) \
  815. SymI_HasProto(rts_getStablePtr) \
  816. SymI_HasProto(rts_getThreadId) \
  817. SymI_HasProto(rts_getWord) \
  818. SymI_HasProto(rts_getWord8) \
  819. SymI_HasProto(rts_getWord16) \
  820. SymI_HasProto(rts_getWord32) \
  821. SymI_HasProto(rts_getWord64) \
  822. SymI_HasProto(rts_lock) \
  823. SymI_HasProto(rts_mkBool) \
  824. SymI_HasProto(rts_mkChar) \
  825. SymI_HasProto(rts_mkDouble) \
  826. SymI_HasProto(rts_mkFloat) \
  827. SymI_HasProto(rts_mkInt) \
  828. SymI_HasProto(rts_mkInt8) \
  829. SymI_HasProto(rts_mkInt16) \
  830. SymI_HasProto(rts_mkInt32) \
  831. SymI_HasProto(rts_mkInt64) \
  832. SymI_HasProto(rts_mkPtr) \
  833. SymI_HasProto(rts_mkFunPtr) \
  834. SymI_HasProto(rts_mkStablePtr) \
  835. SymI_HasProto(rts_mkString) \
  836. SymI_HasProto(rts_mkWord) \
  837. SymI_HasProto(rts_mkWord8) \
  838. SymI_HasProto(rts_mkWord16) \
  839. SymI_HasProto(rts_mkWord32) \
  840. SymI_HasProto(rts_mkWord64) \
  841. SymI_HasProto(rts_unlock) \
  842. SymI_HasProto(rts_unsafeGetMyCapability) \
  843. SymI_HasProto(rtsSupportsBoundThreads) \
  844. SymI_HasProto(rts_isProfiled) \
  845. SymI_HasProto(setProgArgv) \
  846. SymI_HasProto(startupHaskell) \
  847. SymI_HasProto(shutdownHaskell) \
  848. SymI_HasProto(shutdownHaskellAndExit) \
  849. SymI_HasProto(stable_ptr_table) \
  850. SymI_HasProto(stackOverflow) \
  851. SymI_HasProto(stg_CAF_BLACKHOLE_info) \
  852. SymI_HasProto(stg_BLACKHOLE_info) \
  853. SymI_HasProto(__stg_EAGER_BLACKHOLE_info) \
  854. SymI_HasProto(stg_BLOCKING_QUEUE_CLEAN_info) \
  855. SymI_HasProto(stg_BLOCKING_QUEUE_DIRTY_info) \
  856. SymI_HasProto(startTimer) \
  857. SymI_HasProto(stg_MVAR_CLEAN_info) \
  858. SymI_HasProto(stg_MVAR_DIRTY_info) \
  859. SymI_HasProto(stg_IND_STATIC_info) \
  860. SymI_HasProto(stg_ARR_WORDS_info) \
  861. SymI_HasProto(stg_MUT_ARR_PTRS_DIRTY_info) \
  862. SymI_HasProto(stg_MUT_ARR_PTRS_FROZEN_info) \
  863. SymI_HasProto(stg_MUT_ARR_PTRS_FROZEN0_info) \
  864. SymI_HasProto(stg_WEAK_info) \
  865. SymI_HasProto(stg_ap_v_info) \
  866. SymI_HasProto(stg_ap_f_info) \
  867. SymI_HasProto(stg_ap_d_info) \
  868. SymI_HasProto(stg_ap_l_info) \
  869. SymI_HasProto(stg_ap_n_info) \
  870. SymI_HasProto(stg_ap_p_info) \
  871. SymI_HasProto(stg_ap_pv_info) \
  872. SymI_HasProto(stg_ap_pp_info) \
  873. SymI_HasProto(stg_ap_ppv_info) \
  874. SymI_HasProto(stg_ap_ppp_info) \
  875. SymI_HasProto(stg_ap_pppv_info) \
  876. SymI_HasProto(stg_ap_pppp_info) \
  877. SymI_HasProto(stg_ap_ppppp_info) \
  878. SymI_HasProto(stg_ap_pppppp_info) \
  879. SymI_HasProto(stg_ap_0_fast) \
  880. SymI_HasProto(stg_ap_v_fast) \
  881. SymI_HasProto(stg_ap_f_fast) \
  882. SymI_HasProto(stg_ap_d_fast) \
  883. SymI_HasProto(stg_ap_l_fast) \
  884. SymI_HasProto(stg_ap_n_fast) \
  885. SymI_HasProto(stg_ap_p_fast) \
  886. SymI_HasProto(stg_ap_pv_fast) \
  887. SymI_HasProto(stg_ap_pp_fast) \
  888. SymI_HasProto(stg_ap_ppv_fast) \
  889. SymI_HasProto(stg_ap_ppp_fast) \
  890. SymI_HasProto(stg_ap_pppv_fast) \
  891. SymI_HasProto(stg_ap_pppp_fast) \
  892. SymI_HasProto(stg_ap_ppppp_fast) \
  893. SymI_HasProto(stg_ap_pppppp_fast) \
  894. SymI_HasProto(stg_ap_1_upd_info) \
  895. SymI_HasProto(stg_ap_2_upd_info) \
  896. SymI_HasProto(stg_ap_3_upd_info) \
  897. SymI_HasProto(stg_ap_4_upd_info) \
  898. SymI_HasProto(stg_ap_5_upd_info) \
  899. SymI_HasProto(stg_ap_6_upd_info) \
  900. SymI_HasProto(stg_ap_7_upd_info) \
  901. SymI_HasProto(stg_exit) \
  902. SymI_HasProto(stg_sel_0_upd_info) \
  903. SymI_HasProto(stg_sel_10_upd_info) \
  904. SymI_HasProto(stg_sel_11_upd_info) \
  905. SymI_HasProto(stg_sel_12_upd_info) \
  906. SymI_HasProto(stg_sel_13_upd_info) \
  907. SymI_HasProto(stg_sel_14_upd_info) \
  908. SymI_HasProto(stg_sel_15_upd_info) \
  909. SymI_HasProto(stg_sel_1_upd_info) \
  910. SymI_HasProto(stg_sel_2_upd_info) \
  911. SymI_HasProto(stg_sel_3_upd_info) \
  912. SymI_HasProto(stg_sel_4_upd_info) \
  913. SymI_HasProto(stg_sel_5_upd_info) \
  914. SymI_HasProto(stg_sel_6_upd_info) \
  915. SymI_HasProto(stg_sel_7_upd_info) \
  916. SymI_HasProto(stg_sel_8_upd_info) \
  917. SymI_HasProto(stg_sel_9_upd_info) \
  918. SymI_HasProto(stg_upd_frame_info) \
  919. SymI_HasProto(stg_bh_upd_frame_info) \
  920. SymI_HasProto(suspendThread) \
  921. SymI_HasProto(stg_takeMVarzh) \
  922. SymI_HasProto(stg_threadStatuszh) \
  923. SymI_HasProto(stg_tryPutMVarzh) \
  924. SymI_HasProto(stg_tryTakeMVarzh) \
  925. SymI_HasProto(stg_unmaskAsyncExceptionszh) \
  926. SymI_HasProto(unloadObj) \
  927. SymI_HasProto(stg_unsafeThawArrayzh) \
  928. SymI_HasProto(stg_waitReadzh) \
  929. SymI_HasProto(stg_waitWritezh) \
  930. SymI_HasProto(stg_writeTVarzh) \
  931. SymI_HasProto(stg_yieldzh) \
  932. SymI_NeedsProto(stg_interp_constr_entry) \
  933. SymI_HasProto(stg_arg_bitmaps) \
  934. SymI_HasProto(alloc_blocks_lim) \
  935. SymI_HasProto(g0) \
  936. SymI_HasProto(allocate) \
  937. SymI_HasProto(allocateExec) \
  938. SymI_HasProto(freeExec) \
  939. SymI_HasProto(getAllocations) \
  940. SymI_HasProto(revertCAFs) \
  941. SymI_HasProto(RtsFlags) \
  942. SymI_NeedsProto(rts_breakpoint_io_action) \
  943. SymI_NeedsProto(rts_stop_next_breakpoint) \
  944. SymI_NeedsProto(rts_stop_on_exception) \
  945. SymI_HasProto(stopTimer) \
  946. SymI_HasProto(n_capabilities) \
  947. SymI_HasProto(stg_traceCcszh) \
  948. SymI_HasProto(stg_traceEventzh) \
  949. RTS_USER_SIGNALS_SYMBOLS \
  950. RTS_INTCHAR_SYMBOLS
  951. // 64-bit support functions in libgcc.a
  952. #if defined(__GNUC__) && SIZEOF_VOID_P <= 4
  953. #define RTS_LIBGCC_SYMBOLS \
  954. SymI_NeedsProto(__divdi3) \
  955. SymI_NeedsProto(__udivdi3) \
  956. SymI_NeedsProto(__moddi3) \
  957. SymI_NeedsProto(__umoddi3) \
  958. SymI_NeedsProto(__muldi3) \
  959. SymI_NeedsProto(__ashldi3) \
  960. SymI_NeedsProto(__ashrdi3) \
  961. SymI_NeedsProto(__lshrdi3)
  962. #else
  963. #define RTS_LIBGCC_SYMBOLS
  964. #endif
  965. #if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH)
  966. // Symbols that don't have a leading underscore
  967. // on Mac OS X. They have to receive special treatment,
  968. // see machoInitSymbolsWithoutUnderscore()
  969. #define RTS_MACHO_NOUNDERLINE_SYMBOLS \
  970. SymI_NeedsProto(saveFP) \
  971. SymI_NeedsProto(restFP)
  972. #endif
  973. /* entirely bogus claims about types of these symbols */
  974. #define SymI_NeedsProto(vvv) extern void vvv(void);
  975. #if defined(__PIC__) && defined(mingw32_HOST_OS)
  976. #define SymE_HasProto(vvv) SymE_HasProto(vvv);
  977. #define SymE_NeedsProto(vvv) extern void _imp__ ## vvv (void);
  978. #else
  979. #define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv);
  980. #define SymE_HasProto(vvv) SymI_HasProto(vvv)
  981. #endif
  982. #define SymI_HasProto(vvv) /**/
  983. #define SymI_HasProto_redirect(vvv,xxx) /**/
  984. RTS_SYMBOLS
  985. RTS_RET_SYMBOLS
  986. RTS_POSIX_ONLY_SYMBOLS
  987. RTS_MINGW_ONLY_SYMBOLS
  988. RTS_CYGWIN_ONLY_SYMBOLS
  989. RTS_DARWIN_ONLY_SYMBOLS
  990. R

Large files files are truncated, but you can click here to view the full file