Fix AnnDotDot in module export
[ghc.git] / rts / RtsSymbols.c
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2000-2015
4 *
5 * RTS Symbols
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #include "ghcplatform.h"
10 #include "RtsSymbols.h"
11
12 #include "Rts.h"
13 #include "HsFFI.h"
14
15 #include "sm/Storage.h"
16
17 #if !defined(mingw32_HOST_OS)
18 #include "posix/Signals.h"
19 #endif
20
21 #if defined(mingw32_HOST_OS)
22 #include <sys/stat.h>
23 #include <io.h>
24 #include <windows.h>
25 #include <shfolder.h> /* SHGetFolderPathW */
26 #endif
27
28 /* -----------------------------------------------------------------------------
29 * Symbols to be inserted into the RTS symbol table.
30 */
31
32 #define Maybe_Stable_Names SymI_HasProto(stg_mkWeakzh) \
33 SymI_HasProto(stg_mkWeakNoFinalizzerzh) \
34 SymI_HasProto(stg_addCFinalizzerToWeakzh) \
35 SymI_HasProto(stg_makeStableNamezh) \
36 SymI_HasProto(stg_finalizzeWeakzh)
37
38 #define RTS_LIBDW_SYMBOLS \
39 SymE_HasProto(backtraceFree) \
40 SymE_HasProto(libdwGetBacktrace) \
41 SymE_HasProto(libdwLookupLocation) \
42 SymE_HasProto(libdwPoolTake) \
43 SymE_HasProto(libdwPoolRelease) \
44 SymE_HasProto(libdwPoolClear)
45
46 #if !defined (mingw32_HOST_OS)
47 #define RTS_POSIX_ONLY_SYMBOLS \
48 SymI_HasProto(__hscore_get_saved_termios) \
49 SymI_HasProto(__hscore_set_saved_termios) \
50 SymI_HasProto(shutdownHaskellAndSignal) \
51 SymI_HasProto(signal_handlers) \
52 SymI_HasProto(stg_sig_install) \
53 SymI_HasProto(rtsTimerSignal) \
54 SymI_HasProto(atexit) \
55 SymI_NeedsDataProto(nocldstop)
56 #endif
57
58 #if defined(mingw32_HOST_OS)
59 #define RTS_POSIX_ONLY_SYMBOLS /**/
60
61 #if HAVE_GETTIMEOFDAY
62 #define RTS_MINGW_GETTIMEOFDAY_SYM SymI_NeedsProto(gettimeofday)
63 #else
64 #define RTS_MINGW_GETTIMEOFDAY_SYM /**/
65 #endif
66
67 #if HAVE___MINGW_VFPRINTF
68 #define RTS___MINGW_VFPRINTF_SYM SymI_HasProto(__mingw_vfprintf)
69 #else
70 #define RTS___MINGW_VFPRINTF_SYM /**/
71 #endif
72
73 #if defined(i386_HOST_ARCH)
74 #define RTS_WIN32_ONLY(X) X
75 #else
76 #define RTS_WIN32_ONLY(X) /**/
77 #endif
78
79 #if defined(x86_64_HOST_ARCH)
80 #define RTS_WIN64_ONLY(X) X
81 #else
82 #define RTS_WIN64_ONLY(X) /**/
83 #endif
84
85 /* These are statically linked from the mingw libraries into the ghc
86 executable, so we have to employ this hack. */
87 #define RTS_MINGW_ONLY_SYMBOLS \
88 SymI_HasProto(stg_asyncReadzh) \
89 SymI_HasProto(stg_asyncWritezh) \
90 SymI_HasProto(stg_asyncDoProczh) \
91 SymI_HasProto(getWin32ProgArgv) \
92 SymI_HasProto(setWin32ProgArgv) \
93 SymI_HasProto(memset) \
94 SymI_HasProto(inet_ntoa) \
95 SymI_HasProto(inet_addr) \
96 SymI_HasProto(htonl) \
97 SymI_HasProto(recvfrom) \
98 SymI_HasProto(listen) \
99 SymI_HasProto(bind) \
100 SymI_HasProto(shutdown) \
101 SymI_HasProto(connect) \
102 SymI_HasProto(htons) \
103 SymI_HasProto(ntohs) \
104 SymI_HasProto(getservbyname) \
105 SymI_HasProto(getservbyport) \
106 SymI_HasProto(getprotobynumber) \
107 SymI_HasProto(getprotobyname) \
108 SymI_HasProto(gethostbyname) \
109 SymI_HasProto(gethostbyaddr) \
110 SymI_HasProto(gethostname) \
111 SymI_HasProto(strcpy) \
112 SymI_HasProto(strncpy) \
113 SymI_HasProto(abort) \
114 SymI_HasProto(isxdigit) \
115 SymI_HasProto(isupper) \
116 SymI_HasProto(ispunct) \
117 SymI_HasProto(islower) \
118 SymI_HasProto(isspace) \
119 SymI_HasProto(isprint) \
120 SymI_HasProto(isdigit) \
121 SymI_HasProto(iscntrl) \
122 SymI_HasProto(isalpha) \
123 SymI_HasProto(isalnum) \
124 SymI_HasProto(isascii) \
125 RTS___MINGW_VFPRINTF_SYM \
126 SymI_HasProto(strcmp) \
127 SymI_HasProto(memmove) \
128 SymI_HasProto(realloc) \
129 SymI_HasProto(malloc) \
130 SymI_HasProto(pow) \
131 SymI_HasProto(tanh) \
132 SymI_HasProto(cosh) \
133 SymI_HasProto(sinh) \
134 SymI_HasProto(atan) \
135 SymI_HasProto(acos) \
136 SymI_HasProto(asin) \
137 SymI_HasProto(tan) \
138 SymI_HasProto(cos) \
139 SymI_HasProto(sin) \
140 SymI_HasProto(exp) \
141 SymI_HasProto(log) \
142 SymI_HasProto(sqrt) \
143 SymI_HasProto(powf) \
144 SymI_HasProto(tanhf) \
145 SymI_HasProto(coshf) \
146 SymI_HasProto(sinhf) \
147 SymI_HasProto(atanf) \
148 SymI_HasProto(acosf) \
149 SymI_HasProto(asinf) \
150 SymI_HasProto(tanf) \
151 SymI_HasProto(cosf) \
152 SymI_HasProto(sinf) \
153 SymI_HasProto(expf) \
154 SymI_HasProto(logf) \
155 SymI_HasProto(sqrtf) \
156 SymI_HasProto(erf) \
157 SymI_HasProto(erfc) \
158 SymI_HasProto(erff) \
159 SymI_HasProto(erfcf) \
160 SymI_HasProto(expm1) \
161 SymI_HasProto(expm1f) \
162 SymI_HasProto(log1p) \
163 SymI_HasProto(log1pf) \
164 SymI_HasProto(memcpy) \
165 SymI_HasProto(rts_InstallConsoleEvent) \
166 SymI_HasProto(rts_ConsoleHandlerDone) \
167 SymI_NeedsProto(mktime) \
168 SymI_NeedsProto(localtime) \
169 SymI_NeedsProto(gmtime) \
170 SymI_NeedsProto(opendir) \
171 SymI_NeedsProto(readdir) \
172 SymI_NeedsProto(rewinddir) \
173 RTS_WIN32_ONLY(SymI_NeedsProto(__chkstk_ms)) \
174 RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \
175 SymI_NeedsProto(localeconv) \
176 SymI_HasProto(close) \
177 SymI_HasProto(read) \
178 SymI_HasProto(dup) \
179 SymI_HasProto(dup2) \
180 SymI_HasProto(write) \
181 SymI_NeedsProto(getpid) \
182 SymI_HasProto(access) \
183 SymI_HasProto(chmod) \
184 SymI_HasProto(creat) \
185 SymI_HasProto(umask) \
186 SymI_HasProto(unlink) \
187 SymI_HasProto(_errno) \
188 SymI_NeedsProto(ftruncate64) \
189 SymI_HasProto(setmode) \
190 SymI_HasProto(_wstat64) \
191 SymI_HasProto(_fstat64) \
192 SymI_HasProto(_wsopen) \
193 RTS_WIN32_ONLY(SymI_HasProto(_imp___environ)) \
194 RTS_WIN64_ONLY(SymI_HasProto(__imp__environ)) \
195 RTS_WIN32_ONLY(SymI_HasProto(_imp___iob)) \
196 RTS_WIN64_ONLY(SymI_HasProto(__iob_func)) \
197 SymI_HasProto(GetFileAttributesA) \
198 SymI_HasProto(GetFileInformationByHandle) \
199 SymI_HasProto(GetFileType) \
200 SymI_HasProto(GetLastError) \
201 SymI_HasProto(QueryPerformanceFrequency) \
202 SymI_HasProto(QueryPerformanceCounter) \
203 SymI_HasProto(GetTickCount) \
204 SymI_HasProto(WaitForSingleObject) \
205 SymI_HasProto(PeekConsoleInputA) \
206 SymI_HasProto(ReadConsoleInputA) \
207 SymI_HasProto(PeekNamedPipe) \
208 SymI_HasProto(select) \
209 SymI_HasProto(isatty) \
210 SymI_HasProto(_get_osfhandle) \
211 SymI_HasProto(GetConsoleMode) \
212 SymI_HasProto(SetConsoleMode) \
213 SymI_HasProto(FlushConsoleInputBuffer) \
214 SymI_HasProto(free) \
215 SymI_NeedsProto(raise) \
216 SymI_NeedsProto(_getpid) \
217 SymI_HasProto(getc) \
218 SymI_HasProto(ungetc) \
219 SymI_HasProto(puts) \
220 SymI_HasProto(putc) \
221 SymI_HasProto(putchar) \
222 SymI_HasProto(fputc) \
223 SymI_HasProto(fread) \
224 SymI_HasProto(fwrite) \
225 SymI_HasProto(ferror) \
226 SymI_HasProto(printf) \
227 SymI_HasProto(fprintf) \
228 SymI_HasProto(sprintf) \
229 SymI_HasProto(vsprintf) \
230 SymI_HasProto(sscanf) \
231 SymI_HasProto(ldexp) \
232 SymI_HasProto(strlen) \
233 SymI_HasProto(strnlen) \
234 SymI_HasProto(strchr) \
235 SymI_HasProto(strtol) \
236 SymI_HasProto(strerror) \
237 SymI_HasProto(memchr) \
238 SymI_HasProto(memcmp) \
239 SymI_HasProto(wcscpy) \
240 SymI_HasProto(wcslen) \
241 SymI_HasProto(_lseeki64) \
242 SymI_HasProto(_wchmod) \
243 SymI_HasProto(closesocket) \
244 SymI_HasProto(send) \
245 SymI_HasProto(recv) \
246 SymI_HasProto(bsearch) \
247 SymI_HasProto(CommandLineToArgvW) \
248 SymI_HasProto(CreateBitmap) \
249 SymI_HasProto(CreateBitmapIndirect) \
250 SymI_HasProto(CreateCompatibleBitmap) \
251 SymI_HasProto(CreateDIBPatternBrushPt) \
252 SymI_HasProto(CreateDIBitmap) \
253 SymI_HasProto(SetBitmapDimensionEx) \
254 SymI_HasProto(GetBitmapDimensionEx) \
255 SymI_HasProto(GetStockObject) \
256 SymI_HasProto(GetObjectW) \
257 SymI_HasProto(DeleteObject) \
258 SymI_HasProto(SetDIBits) \
259 SymI_HasProto(GetDIBits) \
260 SymI_HasProto(CreateSolidBrush) \
261 SymI_HasProto(CreateHatchBrush) \
262 SymI_HasProto(CreatePatternBrush) \
263 SymI_HasProto(CreateFontW) \
264 SymI_HasProto(AngleArc) \
265 SymI_HasProto(Arc) \
266 SymI_HasProto(ArcTo) \
267 SymI_HasProto(BeginPath) \
268 SymI_HasProto(BitBlt) \
269 SymI_HasProto(CancelDC) \
270 SymI_HasProto(Chord) \
271 SymI_HasProto(CloseFigure) \
272 SymI_HasProto(CombineRgn) \
273 SymI_HasProto(CreateCompatibleDC) \
274 SymI_HasProto(CreateEllipticRgn) \
275 SymI_HasProto(CreateEllipticRgnIndirect) \
276 SymI_HasProto(CreatePen) \
277 SymI_HasProto(CreatePolygonRgn) \
278 SymI_HasProto(CreateRectRgn) \
279 SymI_HasProto(CreateRectRgnIndirect) \
280 SymI_HasProto(CreateRoundRectRgn) \
281 SymI_HasProto(DeleteDC) \
282 SymI_HasProto(Ellipse) \
283 SymI_HasProto(EndPath) \
284 SymI_HasProto(EqualRgn) \
285 SymI_HasProto(ExtSelectClipRgn) \
286 SymI_HasProto(FillPath) \
287 SymI_HasProto(FillRgn) \
288 SymI_HasProto(FlattenPath) \
289 SymI_HasProto(FrameRgn) \
290 SymI_HasProto(GetArcDirection) \
291 SymI_HasProto(GetBkColor) \
292 SymI_HasProto(GetBkMode) \
293 SymI_HasProto(GetBrushOrgEx) \
294 SymI_HasProto(GetCurrentObject) \
295 SymI_HasProto(GetDCOrgEx) \
296 SymI_HasProto(GetGraphicsMode) \
297 SymI_HasProto(GetMiterLimit) \
298 SymI_HasProto(GetPolyFillMode) \
299 SymI_HasProto(GetRgnBox) \
300 SymI_HasProto(GetStretchBltMode) \
301 SymI_HasProto(GetTextAlign) \
302 SymI_HasProto(GetTextCharacterExtra) \
303 SymI_HasProto(GetTextColor) \
304 SymI_HasProto(GetTextExtentPoint32W) \
305 SymI_HasProto(InvertRgn) \
306 SymI_HasProto(LineTo) \
307 SymI_HasProto(MaskBlt) \
308 SymI_HasProto(MoveToEx) \
309 SymI_HasProto(OffsetRgn) \
310 SymI_HasProto(PaintRgn) \
311 SymI_HasProto(PathToRegion) \
312 SymI_HasProto(Pie) \
313 SymI_HasProto(PlgBlt) \
314 SymI_HasProto(PolyBezier) \
315 SymI_HasProto(PolyBezierTo) \
316 SymI_HasProto(Polygon) \
317 SymI_HasProto(Polyline) \
318 SymI_HasProto(PolylineTo) \
319 SymI_HasProto(PtInRegion) \
320 SymI_HasProto(Rectangle) \
321 SymI_HasProto(RectInRegion) \
322 SymI_HasProto(RestoreDC) \
323 SymI_HasProto(RoundRect) \
324 SymI_HasProto(SaveDC) \
325 SymI_HasProto(SelectClipPath) \
326 SymI_HasProto(SelectClipRgn) \
327 SymI_HasProto(SelectObject) \
328 SymI_HasProto(SelectPalette) \
329 SymI_HasProto(SetArcDirection) \
330 SymI_HasProto(SetBkColor) \
331 SymI_HasProto(SetBkMode) \
332 SymI_HasProto(SetBrushOrgEx) \
333 SymI_HasProto(SetGraphicsMode) \
334 SymI_HasProto(SetMiterLimit) \
335 SymI_HasProto(SetPolyFillMode) \
336 SymI_HasProto(SetStretchBltMode) \
337 SymI_HasProto(SetTextAlign) \
338 SymI_HasProto(SetTextCharacterExtra) \
339 SymI_HasProto(SetTextColor) \
340 SymI_HasProto(StretchBlt) \
341 SymI_HasProto(StrokeAndFillPath) \
342 SymI_HasProto(StrokePath) \
343 SymI_HasProto(TextOutW) \
344 SymI_HasProto(timeGetTime) \
345 SymI_HasProto(WidenPath) \
346 SymI_HasProto(GetFileSecurityW) \
347 SymI_HasProto(RegCloseKey) \
348 SymI_HasProto(RegConnectRegistryW) \
349 SymI_HasProto(RegCreateKeyExW) \
350 SymI_HasProto(RegCreateKeyW) \
351 SymI_HasProto(RegDeleteKeyW) \
352 SymI_HasProto(RegDeleteValueW) \
353 SymI_HasProto(RegEnumKeyW) \
354 SymI_HasProto(RegEnumValueW) \
355 SymI_HasProto(RegFlushKey) \
356 SymI_HasProto(RegLoadKeyW) \
357 SymI_HasProto(RegNotifyChangeKeyValue) \
358 SymI_HasProto(RegOpenKeyExW) \
359 SymI_HasProto(RegOpenKeyW) \
360 SymI_HasProto(RegQueryInfoKeyW) \
361 SymI_HasProto(RegQueryValueExW) \
362 SymI_HasProto(RegQueryValueW) \
363 SymI_HasProto(RegReplaceKeyW) \
364 SymI_HasProto(RegRestoreKeyW) \
365 SymI_HasProto(RegSaveKeyW) \
366 SymI_HasProto(RegSetValueExW) \
367 SymI_HasProto(RegSetValueW) \
368 SymI_HasProto(RegUnLoadKeyW) \
369 SymI_HasProto(SHGetFolderPathW) \
370 RTS_WIN32_ONLY(SymI_HasProto(SetWindowLongW)) \
371 RTS_WIN32_ONLY(SymI_HasProto(GetWindowLongW)) \
372 RTS_WIN64_ONLY(SymI_HasProto(SetWindowLongPtrW)) \
373 RTS_WIN64_ONLY(SymI_HasProto(GetWindowLongPtrW)) \
374 SymI_HasProto(MenuItemFromPoint) \
375 SymI_HasProto(ChildWindowFromPoint) \
376 SymI_HasProto(ChildWindowFromPointEx) \
377 SymI_HasProto(UnmapViewOfFile) \
378 SymI_HasProto(CloseHandle) \
379 SymI_HasProto(FreeLibrary) \
380 SymI_HasProto(GetMessageW) \
381 SymI_HasProto(TranslateMessage) \
382 SymI_HasProto(DispatchMessageW) \
383 SymI_HasProto(DefWindowProcW) \
384 SymI_HasProto(GlobalAlloc) \
385 SymI_HasProto(GlobalFree) \
386 SymI_HasProto(CreateFileW) \
387 SymI_HasProto(WriteFile) \
388 SymI_HasProto(FormatMessageW) \
389 SymI_NeedsProto(_localtime64) \
390 SymI_NeedsProto(_tzname) \
391 SymI_NeedsProto(_timezone) \
392 SymI_HasProto(CreatePipe) \
393 SymI_HasProto(SetHandleInformation) \
394 SymI_HasProto(GetStdHandle) \
395 SymI_HasProto(GetCurrentProcess) \
396 SymI_HasProto(DuplicateHandle) \
397 SymI_HasProto(CreateProcessW) \
398 SymI_HasProto(TerminateProcess) \
399 SymI_HasProto(_open_osfhandle) \
400 SymI_HasProto(GetExitCodeProcess) \
401 RTS_MINGW_GETTIMEOFDAY_SYM \
402 SymI_NeedsProto(closedir)
403
404 #else
405 #define RTS_MINGW_ONLY_SYMBOLS /**/
406 #endif
407
408
409 #if defined(darwin_HOST_OS) && HAVE_PRINTF_LDBLSTUB
410 #define RTS_DARWIN_ONLY_SYMBOLS \
411 SymI_NeedsProto(asprintf$LDBLStub) \
412 SymI_NeedsProto(err$LDBLStub) \
413 SymI_NeedsProto(errc$LDBLStub) \
414 SymI_NeedsProto(errx$LDBLStub) \
415 SymI_NeedsProto(fprintf$LDBLStub) \
416 SymI_NeedsProto(fscanf$LDBLStub) \
417 SymI_NeedsProto(fwprintf$LDBLStub) \
418 SymI_NeedsProto(fwscanf$LDBLStub) \
419 SymI_NeedsProto(printf$LDBLStub) \
420 SymI_NeedsProto(scanf$LDBLStub) \
421 SymI_NeedsProto(snprintf$LDBLStub) \
422 SymI_NeedsProto(sprintf$LDBLStub) \
423 SymI_NeedsProto(sscanf$LDBLStub) \
424 SymI_NeedsProto(strtold$LDBLStub) \
425 SymI_NeedsProto(swprintf$LDBLStub) \
426 SymI_NeedsProto(swscanf$LDBLStub) \
427 SymI_NeedsProto(syslog$LDBLStub) \
428 SymI_NeedsProto(vasprintf$LDBLStub) \
429 SymI_NeedsProto(verr$LDBLStub) \
430 SymI_NeedsProto(verrc$LDBLStub) \
431 SymI_NeedsProto(verrx$LDBLStub) \
432 SymI_NeedsProto(vfprintf$LDBLStub) \
433 SymI_NeedsProto(vfscanf$LDBLStub) \
434 SymI_NeedsProto(vfwprintf$LDBLStub) \
435 SymI_NeedsProto(vfwscanf$LDBLStub) \
436 SymI_NeedsProto(vprintf$LDBLStub) \
437 SymI_NeedsProto(vscanf$LDBLStub) \
438 SymI_NeedsProto(vsnprintf$LDBLStub) \
439 SymI_NeedsProto(vsprintf$LDBLStub) \
440 SymI_NeedsProto(vsscanf$LDBLStub) \
441 SymI_NeedsProto(vswprintf$LDBLStub) \
442 SymI_NeedsProto(vswscanf$LDBLStub) \
443 SymI_NeedsProto(vsyslog$LDBLStub) \
444 SymI_NeedsProto(vwarn$LDBLStub) \
445 SymI_NeedsProto(vwarnc$LDBLStub) \
446 SymI_NeedsProto(vwarnx$LDBLStub) \
447 SymI_NeedsProto(vwprintf$LDBLStub) \
448 SymI_NeedsProto(vwscanf$LDBLStub) \
449 SymI_NeedsProto(warn$LDBLStub) \
450 SymI_NeedsProto(warnc$LDBLStub) \
451 SymI_NeedsProto(warnx$LDBLStub) \
452 SymI_NeedsProto(wcstold$LDBLStub) \
453 SymI_NeedsProto(wprintf$LDBLStub) \
454 SymI_NeedsProto(wscanf$LDBLStub)
455 #else
456 #define RTS_DARWIN_ONLY_SYMBOLS
457 #endif
458
459 #if defined(openbsd_HOST_OS)
460 #define RTS_OPENBSD_ONLY_SYMBOLS \
461 SymE_NeedsProto(__guard_local)
462 #else
463 #define RTS_OPENBSD_ONLY_SYMBOLS
464 #endif
465
466 #ifndef SMP
467 # define MAIN_CAP_SYM SymI_HasProto(MainCapability)
468 #else
469 # define MAIN_CAP_SYM
470 #endif
471
472 #if !defined(mingw32_HOST_OS)
473 #define RTS_USER_SIGNALS_SYMBOLS \
474 SymI_HasProto(setIOManagerControlFd) \
475 SymI_HasProto(setTimerManagerControlFd) \
476 SymI_HasProto(setIOManagerWakeupFd) \
477 SymI_HasProto(ioManagerWakeup) \
478 SymI_HasProto(blockUserSignals) \
479 SymI_HasProto(unblockUserSignals)
480 #else
481 #define RTS_USER_SIGNALS_SYMBOLS \
482 SymI_HasProto(ioManagerWakeup) \
483 SymI_HasProto(sendIOManagerEvent) \
484 SymI_HasProto(readIOManagerEvent) \
485 SymI_HasProto(getIOManagerEvent) \
486 SymI_HasProto(console_handler)
487 #endif
488
489 #define RTS_LIBFFI_SYMBOLS \
490 SymE_NeedsProto(ffi_prep_cif) \
491 SymE_NeedsProto(ffi_call) \
492 SymE_NeedsDataProto(ffi_type_void) \
493 SymE_NeedsDataProto(ffi_type_float) \
494 SymE_NeedsDataProto(ffi_type_double) \
495 SymE_NeedsDataProto(ffi_type_sint64) \
496 SymE_NeedsDataProto(ffi_type_uint64) \
497 SymE_NeedsDataProto(ffi_type_sint32) \
498 SymE_NeedsDataProto(ffi_type_uint32) \
499 SymE_NeedsDataProto(ffi_type_sint16) \
500 SymE_NeedsDataProto(ffi_type_uint16) \
501 SymE_NeedsDataProto(ffi_type_sint8) \
502 SymE_NeedsDataProto(ffi_type_uint8) \
503 SymE_NeedsDataProto(ffi_type_pointer)
504
505 #ifdef TABLES_NEXT_TO_CODE
506 #define RTS_RET_SYMBOLS /* nothing */
507 #else
508 #define RTS_RET_SYMBOLS \
509 SymI_HasProto(stg_enter_ret) \
510 SymI_HasProto(stg_gc_fun_ret) \
511 SymI_HasProto(stg_ap_v_ret) \
512 SymI_HasProto(stg_ap_f_ret) \
513 SymI_HasProto(stg_ap_d_ret) \
514 SymI_HasProto(stg_ap_l_ret) \
515 SymI_HasProto(stg_ap_v16_ret) \
516 SymI_HasProto(stg_ap_v32_ret) \
517 SymI_HasProto(stg_ap_v64_ret) \
518 SymI_HasProto(stg_ap_n_ret) \
519 SymI_HasProto(stg_ap_p_ret) \
520 SymI_HasProto(stg_ap_pv_ret) \
521 SymI_HasProto(stg_ap_pp_ret) \
522 SymI_HasProto(stg_ap_ppv_ret) \
523 SymI_HasProto(stg_ap_ppp_ret) \
524 SymI_HasProto(stg_ap_pppv_ret) \
525 SymI_HasProto(stg_ap_pppp_ret) \
526 SymI_HasProto(stg_ap_ppppp_ret) \
527 SymI_HasProto(stg_ap_pppppp_ret)
528 #endif
529
530 /* Modules compiled with -ticky may mention ticky counters */
531 /* This list should marry up with the one in $(TOP)/includes/stg/Ticky.h */
532 #define RTS_TICKY_SYMBOLS \
533 SymI_NeedsDataProto(ticky_entry_ctrs) \
534 SymI_NeedsDataProto(top_ct) \
535 \
536 SymI_HasProto(ENT_VIA_NODE_ctr) \
537 SymI_HasProto(ENT_STATIC_THK_SINGLE_ctr) \
538 SymI_HasProto(ENT_STATIC_THK_MANY_ctr) \
539 SymI_HasProto(ENT_DYN_THK_SINGLE_ctr) \
540 SymI_HasProto(ENT_DYN_THK_MANY_ctr) \
541 SymI_HasProto(ENT_STATIC_FUN_DIRECT_ctr) \
542 SymI_HasProto(ENT_DYN_FUN_DIRECT_ctr) \
543 SymI_HasProto(ENT_STATIC_CON_ctr) \
544 SymI_HasProto(ENT_DYN_CON_ctr) \
545 SymI_HasProto(ENT_STATIC_IND_ctr) \
546 SymI_HasProto(ENT_DYN_IND_ctr) \
547 SymI_HasProto(ENT_PERM_IND_ctr) \
548 SymI_HasProto(ENT_PAP_ctr) \
549 SymI_HasProto(ENT_AP_ctr) \
550 SymI_HasProto(ENT_AP_STACK_ctr) \
551 SymI_HasProto(ENT_BH_ctr) \
552 SymI_HasProto(ENT_LNE_ctr) \
553 SymI_HasProto(UNKNOWN_CALL_ctr) \
554 SymI_HasProto(SLOW_CALL_fast_v16_ctr) \
555 SymI_HasProto(SLOW_CALL_fast_v_ctr) \
556 SymI_HasProto(SLOW_CALL_fast_f_ctr) \
557 SymI_HasProto(SLOW_CALL_fast_d_ctr) \
558 SymI_HasProto(SLOW_CALL_fast_l_ctr) \
559 SymI_HasProto(SLOW_CALL_fast_n_ctr) \
560 SymI_HasProto(SLOW_CALL_fast_p_ctr) \
561 SymI_HasProto(SLOW_CALL_fast_pv_ctr) \
562 SymI_HasProto(SLOW_CALL_fast_pp_ctr) \
563 SymI_HasProto(SLOW_CALL_fast_ppv_ctr) \
564 SymI_HasProto(SLOW_CALL_fast_ppp_ctr) \
565 SymI_HasProto(SLOW_CALL_fast_pppv_ctr) \
566 SymI_HasProto(SLOW_CALL_fast_pppp_ctr) \
567 SymI_HasProto(SLOW_CALL_fast_ppppp_ctr) \
568 SymI_HasProto(SLOW_CALL_fast_pppppp_ctr) \
569 SymI_HasProto(VERY_SLOW_CALL_ctr) \
570 SymI_HasProto(ticky_slow_call_unevald) \
571 SymI_HasProto(SLOW_CALL_ctr) \
572 SymI_HasProto(MULTI_CHUNK_SLOW_CALL_ctr) \
573 SymI_HasProto(MULTI_CHUNK_SLOW_CALL_CHUNKS_ctr) \
574 SymI_HasProto(KNOWN_CALL_ctr) \
575 SymI_HasProto(KNOWN_CALL_TOO_FEW_ARGS_ctr) \
576 SymI_HasProto(KNOWN_CALL_EXTRA_ARGS_ctr) \
577 SymI_HasProto(SLOW_CALL_FUN_TOO_FEW_ctr) \
578 SymI_HasProto(SLOW_CALL_FUN_CORRECT_ctr) \
579 SymI_HasProto(SLOW_CALL_FUN_TOO_MANY_ctr) \
580 SymI_HasProto(SLOW_CALL_PAP_TOO_FEW_ctr) \
581 SymI_HasProto(SLOW_CALL_PAP_CORRECT_ctr) \
582 SymI_HasProto(SLOW_CALL_PAP_TOO_MANY_ctr) \
583 SymI_HasProto(SLOW_CALL_UNEVALD_ctr) \
584 SymI_HasProto(UPDF_OMITTED_ctr) \
585 SymI_HasProto(UPDF_PUSHED_ctr) \
586 SymI_HasProto(CATCHF_PUSHED_ctr) \
587 SymI_HasProto(UPDF_RCC_PUSHED_ctr) \
588 SymI_HasProto(UPDF_RCC_OMITTED_ctr) \
589 SymI_HasProto(UPD_SQUEEZED_ctr) \
590 SymI_HasProto(UPD_CON_IN_NEW_ctr) \
591 SymI_HasProto(UPD_CON_IN_PLACE_ctr) \
592 SymI_HasProto(UPD_PAP_IN_NEW_ctr) \
593 SymI_HasProto(UPD_PAP_IN_PLACE_ctr) \
594 SymI_HasProto(ALLOC_HEAP_ctr) \
595 SymI_HasProto(ALLOC_HEAP_tot) \
596 SymI_HasProto(HEAP_CHK_ctr) \
597 SymI_HasProto(STK_CHK_ctr) \
598 SymI_HasProto(ALLOC_RTS_ctr) \
599 SymI_HasProto(ALLOC_RTS_tot) \
600 SymI_HasProto(ALLOC_FUN_ctr) \
601 SymI_HasProto(ALLOC_FUN_adm) \
602 SymI_HasProto(ALLOC_FUN_gds) \
603 SymI_HasProto(ALLOC_FUN_slp) \
604 SymI_HasProto(UPD_NEW_IND_ctr) \
605 SymI_HasProto(UPD_NEW_PERM_IND_ctr) \
606 SymI_HasProto(UPD_OLD_IND_ctr) \
607 SymI_HasProto(UPD_OLD_PERM_IND_ctr) \
608 SymI_HasProto(UPD_CAF_BH_UPDATABLE_ctr) \
609 SymI_HasProto(UPD_CAF_BH_SINGLE_ENTRY_ctr) \
610 SymI_HasProto(GC_SEL_ABANDONED_ctr) \
611 SymI_HasProto(GC_SEL_MINOR_ctr) \
612 SymI_HasProto(GC_SEL_MAJOR_ctr) \
613 SymI_HasProto(GC_FAILED_PROMOTION_ctr) \
614 SymI_HasProto(ALLOC_UP_THK_ctr) \
615 SymI_HasProto(ALLOC_SE_THK_ctr) \
616 SymI_HasProto(ALLOC_THK_adm) \
617 SymI_HasProto(ALLOC_THK_gds) \
618 SymI_HasProto(ALLOC_THK_slp) \
619 SymI_HasProto(ALLOC_CON_ctr) \
620 SymI_HasProto(ALLOC_CON_adm) \
621 SymI_HasProto(ALLOC_CON_gds) \
622 SymI_HasProto(ALLOC_CON_slp) \
623 SymI_HasProto(ALLOC_TUP_ctr) \
624 SymI_HasProto(ALLOC_TUP_adm) \
625 SymI_HasProto(ALLOC_TUP_gds) \
626 SymI_HasProto(ALLOC_TUP_slp) \
627 SymI_HasProto(ALLOC_BH_ctr) \
628 SymI_HasProto(ALLOC_BH_adm) \
629 SymI_HasProto(ALLOC_BH_gds) \
630 SymI_HasProto(ALLOC_BH_slp) \
631 SymI_HasProto(ALLOC_PRIM_ctr) \
632 SymI_HasProto(ALLOC_PRIM_adm) \
633 SymI_HasProto(ALLOC_PRIM_gds) \
634 SymI_HasProto(ALLOC_PRIM_slp) \
635 SymI_HasProto(ALLOC_PAP_ctr) \
636 SymI_HasProto(ALLOC_PAP_adm) \
637 SymI_HasProto(ALLOC_PAP_gds) \
638 SymI_HasProto(ALLOC_PAP_slp) \
639 SymI_HasProto(ALLOC_TSO_ctr) \
640 SymI_HasProto(ALLOC_TSO_adm) \
641 SymI_HasProto(ALLOC_TSO_gds) \
642 SymI_HasProto(ALLOC_TSO_slp) \
643 SymI_HasProto(RET_NEW_ctr) \
644 SymI_HasProto(RET_OLD_ctr) \
645 SymI_HasProto(RET_UNBOXED_TUP_ctr) \
646 SymI_HasProto(RET_SEMI_loads_avoided)
647
648
649 // On most platforms, the garbage collector rewrites references
650 // to small integer and char objects to a set of common, shared ones.
651 //
652 // We don't do this when compiling to Windows DLLs at the moment because
653 // it doesn't support cross package data references well.
654 //
655 #if defined(COMPILING_WINDOWS_DLL)
656 #define RTS_INTCHAR_SYMBOLS
657 #else
658 #define RTS_INTCHAR_SYMBOLS \
659 SymI_HasProto(stg_CHARLIKE_closure) \
660 SymI_HasProto(stg_INTLIKE_closure)
661 #endif
662
663 #if defined(PROFILING)
664 #define RTS_PROF_SYMBOLS \
665 SymI_HasProto(CCS_DONT_CARE) \
666 SymI_HasProto(CC_LIST) \
667 SymI_HasProto(CC_ID) \
668 SymI_HasProto(CCS_LIST) \
669 SymI_HasProto(CCS_ID) \
670 SymI_HasProto(stg_restore_cccs_info) \
671 SymI_HasProto(enterFunCCS) \
672 SymI_HasProto(pushCostCentre) \
673 SymI_HasProto(era)
674 #else
675 #define RTS_PROF_SYMBOLS /* empty */
676 #endif
677
678 #define RTS_SYMBOLS \
679 Maybe_Stable_Names \
680 RTS_TICKY_SYMBOLS \
681 RTS_PROF_SYMBOLS \
682 RTS_LIBDW_SYMBOLS \
683 SymI_HasProto(StgReturn) \
684 SymI_HasProto(stg_gc_noregs) \
685 SymI_HasProto(stg_ret_v_info) \
686 SymI_HasProto(stg_ret_p_info) \
687 SymI_HasProto(stg_ret_n_info) \
688 SymI_HasProto(stg_ret_f_info) \
689 SymI_HasProto(stg_ret_d_info) \
690 SymI_HasProto(stg_ret_l_info) \
691 SymI_HasProto(stg_gc_prim_p) \
692 SymI_HasProto(stg_gc_prim_pp) \
693 SymI_HasProto(stg_gc_prim_n) \
694 SymI_HasProto(stg_enter_info) \
695 SymI_HasProto(__stg_gc_enter_1) \
696 SymI_HasProto(stg_gc_unpt_r1) \
697 SymI_HasProto(stg_gc_unbx_r1) \
698 SymI_HasProto(stg_gc_f1) \
699 SymI_HasProto(stg_gc_d1) \
700 SymI_HasProto(stg_gc_l1) \
701 SymI_HasProto(stg_gc_pp) \
702 SymI_HasProto(stg_gc_ppp) \
703 SymI_HasProto(stg_gc_pppp) \
704 SymI_HasProto(__stg_gc_fun) \
705 SymI_HasProto(stg_gc_fun_info) \
706 SymI_HasProto(stg_yield_noregs) \
707 SymI_HasProto(stg_yield_to_interpreter) \
708 SymI_HasProto(stg_block_noregs) \
709 SymI_HasProto(stg_block_takemvar) \
710 SymI_HasProto(stg_block_readmvar) \
711 SymI_HasProto(stg_block_putmvar) \
712 MAIN_CAP_SYM \
713 SymI_HasProto(addDLL) \
714 SymI_HasProto(addLibrarySearchPath) \
715 SymI_HasProto(removeLibrarySearchPath) \
716 SymI_HasProto(findSystemLibrary) \
717 SymI_HasProto(__int_encodeDouble) \
718 SymI_HasProto(__word_encodeDouble) \
719 SymI_HasProto(__int_encodeFloat) \
720 SymI_HasProto(__word_encodeFloat) \
721 SymI_HasProto(stg_atomicallyzh) \
722 SymI_HasProto(barf) \
723 SymI_HasProto(deRefStablePtr) \
724 SymI_HasProto(debugBelch) \
725 SymI_HasProto(errorBelch) \
726 SymI_HasProto(sysErrorBelch) \
727 SymI_HasProto(stg_getMaskingStatezh) \
728 SymI_HasProto(stg_maskAsyncExceptionszh) \
729 SymI_HasProto(stg_maskUninterruptiblezh) \
730 SymI_HasProto(stg_catchzh) \
731 SymI_HasProto(stg_catchRetryzh) \
732 SymI_HasProto(stg_catchSTMzh) \
733 SymI_HasProto(stg_checkzh) \
734 SymI_HasProto(closure_flags) \
735 SymI_HasProto(cmp_thread) \
736 SymI_HasProto(createAdjustor) \
737 SymI_HasProto(stg_decodeDoublezu2Intzh) \
738 SymI_HasProto(stg_decodeDoublezuInt64zh) \
739 SymI_HasProto(stg_decodeFloatzuIntzh) \
740 SymI_HasProto(stg_delayzh) \
741 SymI_HasProto(stg_deRefWeakzh) \
742 SymI_HasProto(stg_deRefStablePtrzh) \
743 SymI_HasProto(dirty_MUT_VAR) \
744 SymI_HasProto(dirty_TVAR) \
745 SymI_HasProto(stg_forkzh) \
746 SymI_HasProto(stg_forkOnzh) \
747 SymI_HasProto(forkProcess) \
748 SymI_HasProto(forkOS_createThread) \
749 SymI_HasProto(freeHaskellFunctionPtr) \
750 SymI_HasProto(getOrSetGHCConcSignalSignalHandlerStore) \
751 SymI_HasProto(getOrSetGHCConcWindowsPendingDelaysStore) \
752 SymI_HasProto(getOrSetGHCConcWindowsIOManagerThreadStore) \
753 SymI_HasProto(getOrSetGHCConcWindowsProddingStore) \
754 SymI_HasProto(getOrSetSystemEventThreadEventManagerStore) \
755 SymI_HasProto(getOrSetSystemEventThreadIOManagerThreadStore) \
756 SymI_HasProto(getOrSetSystemTimerThreadEventManagerStore) \
757 SymI_HasProto(getOrSetSystemTimerThreadIOManagerThreadStore) \
758 SymI_HasProto(getOrSetLibHSghcFastStringTable) \
759 SymI_HasProto(getGCStats) \
760 SymI_HasProto(getGCStatsEnabled) \
761 SymI_HasProto(genericRaise) \
762 SymI_HasProto(getProgArgv) \
763 SymI_HasProto(getFullProgArgv) \
764 SymI_HasProto(getStablePtr) \
765 SymI_HasProto(foreignExportStablePtr) \
766 SymI_HasProto(hs_init) \
767 SymI_HasProto(hs_exit) \
768 SymI_HasProto(hs_set_argv) \
769 SymI_HasProto(hs_add_root) \
770 SymI_HasProto(hs_perform_gc) \
771 SymI_HasProto(hs_lock_stable_tables) \
772 SymI_HasProto(hs_unlock_stable_tables) \
773 SymI_HasProto(hs_free_stable_ptr) \
774 SymI_HasProto(hs_free_stable_ptr_unsafe) \
775 SymI_HasProto(hs_free_fun_ptr) \
776 SymI_HasProto(hs_hpc_rootModule) \
777 SymI_HasProto(hs_hpc_module) \
778 SymI_HasProto(initLinker) \
779 SymI_HasProto(initLinker_) \
780 SymI_HasProto(stg_unpackClosurezh) \
781 SymI_HasProto(stg_getApStackValzh) \
782 SymI_HasProto(stg_getSparkzh) \
783 SymI_HasProto(stg_numSparkszh) \
784 SymI_HasProto(stg_isCurrentThreadBoundzh) \
785 SymI_HasProto(stg_isEmptyMVarzh) \
786 SymI_HasProto(stg_killThreadzh) \
787 SymI_HasProto(loadArchive) \
788 SymI_HasProto(loadObj) \
789 SymI_HasProto(insertSymbol) \
790 SymI_HasProto(lookupSymbol) \
791 SymI_HasProto(stg_makeStablePtrzh) \
792 SymI_HasProto(stg_mkApUpd0zh) \
793 SymI_HasProto(stg_myThreadIdzh) \
794 SymI_HasProto(stg_labelThreadzh) \
795 SymI_HasProto(stg_newArrayzh) \
796 SymI_HasProto(stg_copyArrayzh) \
797 SymI_HasProto(stg_copyMutableArrayzh) \
798 SymI_HasProto(stg_copyArrayArrayzh) \
799 SymI_HasProto(stg_copyMutableArrayArrayzh) \
800 SymI_HasProto(stg_cloneArrayzh) \
801 SymI_HasProto(stg_cloneMutableArrayzh) \
802 SymI_HasProto(stg_freezzeArrayzh) \
803 SymI_HasProto(stg_thawArrayzh) \
804 SymI_HasProto(stg_newArrayArrayzh) \
805 SymI_HasProto(stg_casArrayzh) \
806 SymI_HasProto(stg_newSmallArrayzh) \
807 SymI_HasProto(stg_unsafeThawSmallArrayzh) \
808 SymI_HasProto(stg_cloneSmallArrayzh) \
809 SymI_HasProto(stg_cloneSmallMutableArrayzh) \
810 SymI_HasProto(stg_freezzeSmallArrayzh) \
811 SymI_HasProto(stg_thawSmallArrayzh) \
812 SymI_HasProto(stg_copySmallArrayzh) \
813 SymI_HasProto(stg_copySmallMutableArrayzh) \
814 SymI_HasProto(stg_casSmallArrayzh) \
815 SymI_HasProto(stg_newBCOzh) \
816 SymI_HasProto(stg_newByteArrayzh) \
817 SymI_HasProto(stg_casIntArrayzh) \
818 SymI_HasProto(stg_newMVarzh) \
819 SymI_HasProto(stg_newMutVarzh) \
820 SymI_HasProto(stg_newTVarzh) \
821 SymI_HasProto(stg_noDuplicatezh) \
822 SymI_HasProto(stg_atomicModifyMutVarzh) \
823 SymI_HasProto(stg_casMutVarzh) \
824 SymI_HasProto(stg_newPinnedByteArrayzh) \
825 SymI_HasProto(stg_newAlignedPinnedByteArrayzh) \
826 SymI_HasProto(stg_shrinkMutableByteArrayzh) \
827 SymI_HasProto(stg_resizzeMutableByteArrayzh) \
828 SymI_HasProto(newSpark) \
829 SymI_HasProto(performGC) \
830 SymI_HasProto(performMajorGC) \
831 SymI_HasProto(prog_argc) \
832 SymI_HasProto(prog_argv) \
833 SymI_HasProto(stg_putMVarzh) \
834 SymI_HasProto(stg_raisezh) \
835 SymI_HasProto(stg_raiseIOzh) \
836 SymI_HasProto(stg_readTVarzh) \
837 SymI_HasProto(stg_readTVarIOzh) \
838 SymI_HasProto(resumeThread) \
839 SymI_HasProto(setNumCapabilities) \
840 SymI_HasProto(getNumberOfProcessors) \
841 SymI_HasProto(resolveObjs) \
842 SymI_HasProto(stg_retryzh) \
843 SymI_HasProto(rts_apply) \
844 SymI_HasProto(rts_checkSchedStatus) \
845 SymI_HasProto(rts_eval) \
846 SymI_HasProto(rts_evalIO) \
847 SymI_HasProto(rts_evalLazyIO) \
848 SymI_HasProto(rts_evalStableIO) \
849 SymI_HasProto(rts_eval_) \
850 SymI_HasProto(rts_getBool) \
851 SymI_HasProto(rts_getChar) \
852 SymI_HasProto(rts_getDouble) \
853 SymI_HasProto(rts_getFloat) \
854 SymI_HasProto(rts_getInt) \
855 SymI_HasProto(rts_getInt8) \
856 SymI_HasProto(rts_getInt16) \
857 SymI_HasProto(rts_getInt32) \
858 SymI_HasProto(rts_getInt64) \
859 SymI_HasProto(rts_getPtr) \
860 SymI_HasProto(rts_getFunPtr) \
861 SymI_HasProto(rts_getStablePtr) \
862 SymI_HasProto(rts_getThreadId) \
863 SymI_HasProto(rts_getWord) \
864 SymI_HasProto(rts_getWord8) \
865 SymI_HasProto(rts_getWord16) \
866 SymI_HasProto(rts_getWord32) \
867 SymI_HasProto(rts_getWord64) \
868 SymI_HasProto(rts_lock) \
869 SymI_HasProto(rts_mkBool) \
870 SymI_HasProto(rts_mkChar) \
871 SymI_HasProto(rts_mkDouble) \
872 SymI_HasProto(rts_mkFloat) \
873 SymI_HasProto(rts_mkInt) \
874 SymI_HasProto(rts_mkInt8) \
875 SymI_HasProto(rts_mkInt16) \
876 SymI_HasProto(rts_mkInt32) \
877 SymI_HasProto(rts_mkInt64) \
878 SymI_HasProto(rts_mkPtr) \
879 SymI_HasProto(rts_mkFunPtr) \
880 SymI_HasProto(rts_mkStablePtr) \
881 SymI_HasProto(rts_mkString) \
882 SymI_HasProto(rts_mkWord) \
883 SymI_HasProto(rts_mkWord8) \
884 SymI_HasProto(rts_mkWord16) \
885 SymI_HasProto(rts_mkWord32) \
886 SymI_HasProto(rts_mkWord64) \
887 SymI_HasProto(rts_unlock) \
888 SymI_HasProto(rts_unsafeGetMyCapability) \
889 SymI_HasProto(rtsSupportsBoundThreads) \
890 SymI_HasProto(rts_isProfiled) \
891 SymI_HasProto(rts_isDynamic) \
892 SymI_HasProto(rts_getThreadAllocationCounter) \
893 SymI_HasProto(rts_setThreadAllocationCounter) \
894 SymI_HasProto(rts_enableThreadAllocationLimit) \
895 SymI_HasProto(rts_disableThreadAllocationLimit) \
896 SymI_HasProto(setProgArgv) \
897 SymI_HasProto(startupHaskell) \
898 SymI_HasProto(shutdownHaskell) \
899 SymI_HasProto(shutdownHaskellAndExit) \
900 SymI_HasProto(stable_name_table) \
901 SymI_HasProto(stable_ptr_table) \
902 SymI_HasProto(stackOverflow) \
903 SymI_HasProto(stg_CAF_BLACKHOLE_info) \
904 SymI_HasProto(stg_BLACKHOLE_info) \
905 SymI_HasProto(__stg_EAGER_BLACKHOLE_info) \
906 SymI_HasProto(stg_BLOCKING_QUEUE_CLEAN_info) \
907 SymI_HasProto(stg_BLOCKING_QUEUE_DIRTY_info) \
908 SymI_HasProto(startTimer) \
909 SymI_HasProto(stg_MVAR_CLEAN_info) \
910 SymI_HasProto(stg_MVAR_DIRTY_info) \
911 SymI_HasProto(stg_TVAR_CLEAN_info) \
912 SymI_HasProto(stg_TVAR_DIRTY_info) \
913 SymI_HasProto(stg_IND_STATIC_info) \
914 SymI_HasProto(stg_ARR_WORDS_info) \
915 SymI_HasProto(stg_MUT_ARR_PTRS_DIRTY_info) \
916 SymI_HasProto(stg_MUT_ARR_PTRS_FROZEN_info) \
917 SymI_HasProto(stg_MUT_ARR_PTRS_FROZEN0_info) \
918 SymI_HasProto(stg_SMALL_MUT_ARR_PTRS_DIRTY_info) \
919 SymI_HasProto(stg_SMALL_MUT_ARR_PTRS_FROZEN_info) \
920 SymI_HasProto(stg_SMALL_MUT_ARR_PTRS_FROZEN0_info) \
921 SymI_HasProto(stg_MUT_VAR_CLEAN_info) \
922 SymI_HasProto(stg_MUT_VAR_DIRTY_info) \
923 SymI_HasProto(stg_WEAK_info) \
924 SymI_HasProto(stg_ap_v_info) \
925 SymI_HasProto(stg_ap_f_info) \
926 SymI_HasProto(stg_ap_d_info) \
927 SymI_HasProto(stg_ap_l_info) \
928 SymI_HasProto(stg_ap_v16_info) \
929 SymI_HasProto(stg_ap_v32_info) \
930 SymI_HasProto(stg_ap_v64_info) \
931 SymI_HasProto(stg_ap_n_info) \
932 SymI_HasProto(stg_ap_p_info) \
933 SymI_HasProto(stg_ap_pv_info) \
934 SymI_HasProto(stg_ap_pp_info) \
935 SymI_HasProto(stg_ap_ppv_info) \
936 SymI_HasProto(stg_ap_ppp_info) \
937 SymI_HasProto(stg_ap_pppv_info) \
938 SymI_HasProto(stg_ap_pppp_info) \
939 SymI_HasProto(stg_ap_ppppp_info) \
940 SymI_HasProto(stg_ap_pppppp_info) \
941 SymI_HasProto(stg_ap_0_fast) \
942 SymI_HasProto(stg_ap_v_fast) \
943 SymI_HasProto(stg_ap_f_fast) \
944 SymI_HasProto(stg_ap_d_fast) \
945 SymI_HasProto(stg_ap_l_fast) \
946 SymI_HasProto(stg_ap_v16_fast) \
947 SymI_HasProto(stg_ap_v32_fast) \
948 SymI_HasProto(stg_ap_v64_fast) \
949 SymI_HasProto(stg_ap_n_fast) \
950 SymI_HasProto(stg_ap_p_fast) \
951 SymI_HasProto(stg_ap_pv_fast) \
952 SymI_HasProto(stg_ap_pp_fast) \
953 SymI_HasProto(stg_ap_ppv_fast) \
954 SymI_HasProto(stg_ap_ppp_fast) \
955 SymI_HasProto(stg_ap_pppv_fast) \
956 SymI_HasProto(stg_ap_pppp_fast) \
957 SymI_HasProto(stg_ap_ppppp_fast) \
958 SymI_HasProto(stg_ap_pppppp_fast) \
959 SymI_HasProto(stg_ap_1_upd_info) \
960 SymI_HasProto(stg_ap_2_upd_info) \
961 SymI_HasProto(stg_ap_3_upd_info) \
962 SymI_HasProto(stg_ap_4_upd_info) \
963 SymI_HasProto(stg_ap_5_upd_info) \
964 SymI_HasProto(stg_ap_6_upd_info) \
965 SymI_HasProto(stg_ap_7_upd_info) \
966 SymI_HasProto(stg_exit) \
967 SymI_HasProto(stg_sel_0_upd_info) \
968 SymI_HasProto(stg_sel_1_upd_info) \
969 SymI_HasProto(stg_sel_2_upd_info) \
970 SymI_HasProto(stg_sel_3_upd_info) \
971 SymI_HasProto(stg_sel_4_upd_info) \
972 SymI_HasProto(stg_sel_5_upd_info) \
973 SymI_HasProto(stg_sel_6_upd_info) \
974 SymI_HasProto(stg_sel_7_upd_info) \
975 SymI_HasProto(stg_sel_8_upd_info) \
976 SymI_HasProto(stg_sel_9_upd_info) \
977 SymI_HasProto(stg_sel_10_upd_info) \
978 SymI_HasProto(stg_sel_11_upd_info) \
979 SymI_HasProto(stg_sel_12_upd_info) \
980 SymI_HasProto(stg_sel_13_upd_info) \
981 SymI_HasProto(stg_sel_14_upd_info) \
982 SymI_HasProto(stg_sel_15_upd_info) \
983 SymI_HasProto(stg_sel_0_noupd_info) \
984 SymI_HasProto(stg_sel_1_noupd_info) \
985 SymI_HasProto(stg_sel_2_noupd_info) \
986 SymI_HasProto(stg_sel_3_noupd_info) \
987 SymI_HasProto(stg_sel_4_noupd_info) \
988 SymI_HasProto(stg_sel_5_noupd_info) \
989 SymI_HasProto(stg_sel_6_noupd_info) \
990 SymI_HasProto(stg_sel_7_noupd_info) \
991 SymI_HasProto(stg_sel_8_noupd_info) \
992 SymI_HasProto(stg_sel_9_noupd_info) \
993 SymI_HasProto(stg_sel_10_noupd_info) \
994 SymI_HasProto(stg_sel_11_noupd_info) \
995 SymI_HasProto(stg_sel_12_noupd_info) \
996 SymI_HasProto(stg_sel_13_noupd_info) \
997 SymI_HasProto(stg_sel_14_noupd_info) \
998 SymI_HasProto(stg_sel_15_noupd_info) \
999 SymI_HasProto(stg_upd_frame_info) \
1000 SymI_HasProto(stg_bh_upd_frame_info) \
1001 SymI_HasProto(suspendThread) \
1002 SymI_HasProto(stg_takeMVarzh) \
1003 SymI_HasProto(stg_readMVarzh) \
1004 SymI_HasProto(stg_threadStatuszh) \
1005 SymI_HasProto(stg_tryPutMVarzh) \
1006 SymI_HasProto(stg_tryTakeMVarzh) \
1007 SymI_HasProto(stg_tryReadMVarzh) \
1008 SymI_HasProto(stg_unmaskAsyncExceptionszh) \
1009 SymI_HasProto(unloadObj) \
1010 SymI_HasProto(stg_unsafeThawArrayzh) \
1011 SymI_HasProto(stg_waitReadzh) \
1012 SymI_HasProto(stg_waitWritezh) \
1013 SymI_HasProto(stg_writeTVarzh) \
1014 SymI_HasProto(stg_yieldzh) \
1015 SymI_NeedsProto(stg_interp_constr_entry) \
1016 SymI_HasProto(stg_arg_bitmaps) \
1017 SymI_HasProto(large_alloc_lim) \
1018 SymI_HasProto(g0) \
1019 SymI_HasProto(allocate) \
1020 SymI_HasProto(allocateExec) \
1021 SymI_HasProto(flushExec) \
1022 SymI_HasProto(freeExec) \
1023 SymI_HasProto(getAllocations) \
1024 SymI_HasProto(revertCAFs) \
1025 SymI_HasProto(RtsFlags) \
1026 SymI_NeedsDataProto(rts_breakpoint_io_action) \
1027 SymI_NeedsDataProto(rts_stop_next_breakpoint) \
1028 SymI_NeedsDataProto(rts_stop_on_exception) \
1029 SymI_HasProto(stopTimer) \
1030 SymI_HasProto(n_capabilities) \
1031 SymI_HasProto(enabled_capabilities) \
1032 SymI_HasProto(stg_traceCcszh) \
1033 SymI_HasProto(stg_traceEventzh) \
1034 SymI_HasProto(stg_traceMarkerzh) \
1035 SymI_HasProto(getMonotonicNSec) \
1036 SymI_HasProto(lockFile) \
1037 SymI_HasProto(unlockFile) \
1038 SymI_HasProto(startProfTimer) \
1039 SymI_HasProto(stopProfTimer) \
1040 SymI_HasProto(atomic_inc) \
1041 SymI_HasProto(atomic_dec) \
1042 SymI_HasProto(hs_spt_lookup) \
1043 SymI_HasProto(hs_spt_insert) \
1044 SymI_HasProto(hs_spt_remove) \
1045 SymI_HasProto(hs_spt_keys) \
1046 SymI_HasProto(hs_spt_key_count) \
1047 RTS_USER_SIGNALS_SYMBOLS \
1048 RTS_INTCHAR_SYMBOLS
1049
1050
1051 // 64-bit support functions in libgcc.a
1052 #if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
1053 #define RTS_LIBGCC_SYMBOLS \
1054 SymI_NeedsProto(__divdi3) \
1055 SymI_NeedsProto(__udivdi3) \
1056 SymI_NeedsProto(__moddi3) \
1057 SymI_NeedsProto(__umoddi3) \
1058 SymI_NeedsProto(__muldi3) \
1059 SymI_NeedsProto(__ashldi3) \
1060 SymI_NeedsProto(__ashrdi3) \
1061 SymI_NeedsProto(__lshrdi3) \
1062 SymI_NeedsProto(__fixunsdfdi)
1063 #else
1064 #define RTS_LIBGCC_SYMBOLS
1065 #endif
1066
1067 #if defined(darwin_HOST_OS) && defined(powerpc_HOST_ARCH)
1068 // Symbols that don't have a leading underscore
1069 // on Mac OS X. They have to receive special treatment,
1070 // see machoInitSymbolsWithoutUnderscore()
1071 #define RTS_MACHO_NOUNDERLINE_SYMBOLS \
1072 SymI_NeedsProto(saveFP) \
1073 SymI_NeedsProto(restFP)
1074 #endif
1075
1076 /* entirely bogus claims about types of these symbols */
1077 #define SymI_NeedsProto(vvv) extern void vvv(void);
1078 #define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
1079 #if defined(COMPILING_WINDOWS_DLL)
1080 #define SymE_HasProto(vvv) SymE_HasProto(vvv);
1081 # if defined(x86_64_HOST_ARCH)
1082 # define SymE_NeedsProto(vvv) extern void __imp_ ## vvv (void);
1083 # define SymE_NeedsDataProto(vvv) SymE_NeedsProto(vvv)
1084 # else
1085 # define SymE_NeedsProto(vvv) extern void _imp__ ## vvv (void);
1086 # define SymE_NeedsDataProto(vvv) SymE_NeedsProto(vvv)
1087 # endif
1088 #else
1089 #define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv);
1090 #define SymE_NeedsDataProto(vvv) SymI_NeedsDataProto(vvv);
1091 #define SymE_HasProto(vvv) SymI_HasProto(vvv)
1092 #endif
1093 #define SymI_HasProto(vvv) /**/
1094 #define SymI_HasProto_redirect(vvv,xxx) /**/
1095 RTS_SYMBOLS
1096 RTS_RET_SYMBOLS
1097 RTS_POSIX_ONLY_SYMBOLS
1098 RTS_MINGW_ONLY_SYMBOLS
1099 RTS_DARWIN_ONLY_SYMBOLS
1100 RTS_OPENBSD_ONLY_SYMBOLS
1101 RTS_LIBGCC_SYMBOLS
1102 RTS_LIBFFI_SYMBOLS
1103 #undef SymI_NeedsProto
1104 #undef SymI_NeedsDataProto
1105 #undef SymI_HasProto
1106 #undef SymI_HasProto_redirect
1107 #undef SymE_HasProto
1108 #undef SymE_HasDataProto
1109 #undef SymE_NeedsProto
1110 #undef SymE_NeedsDataProto
1111
1112 #define SymI_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
1113 (void*)(&(vvv)) },
1114 #define SymI_HasDataProto(vvv) \
1115 SymI_HasProto(vvv)
1116 #define SymE_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
1117 (void*)DLL_IMPORT_DATA_REF(vvv) },
1118 #define SymE_HasDataProto(vvv) \
1119 SymE_HasProto(vvv)
1120
1121 #define SymI_NeedsProto(vvv) SymI_HasProto(vvv)
1122 #define SymI_NeedsDataProto(vvv) SymI_HasDataProto(vvv)
1123 #define SymE_NeedsProto(vvv) SymE_HasProto(vvv)
1124 #define SymE_NeedsDataProto(vvv) SymE_HasDataProto(vvv)
1125
1126 // SymI_HasProto_redirect allows us to redirect references to one symbol to
1127 // another symbol. See newCAF/newRetainedCAF/newGCdCAF for an example.
1128 #define SymI_HasProto_redirect(vvv,xxx) \
1129 { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
1130 (void*)(&(xxx)) },
1131
1132 RtsSymbolVal rtsSyms[] = {
1133 RTS_SYMBOLS
1134 RTS_RET_SYMBOLS
1135 RTS_POSIX_ONLY_SYMBOLS
1136 RTS_MINGW_ONLY_SYMBOLS
1137 RTS_DARWIN_ONLY_SYMBOLS
1138 RTS_OPENBSD_ONLY_SYMBOLS
1139 RTS_LIBGCC_SYMBOLS
1140 RTS_LIBFFI_SYMBOLS
1141 #if defined(darwin_HOST_OS) && defined(i386_HOST_ARCH)
1142 // dyld stub code contains references to this,
1143 // but it should never be called because we treat
1144 // lazy pointers as nonlazy.
1145 { "dyld_stub_binding_helper", (void*)0xDEADBEEF },
1146 #endif
1147 { 0, 0 } /* sentinel */
1148 };