| 1 | //===- macho_platform.h -----------------------------------------*- C++ -*-===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // ORC Runtime support for Darwin dynamic loading features. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | #ifndef ORC_RT_MACHO_PLATFORM_H |
| 14 | #define ORC_RT_MACHO_PLATFORM_H |
| 15 | |
| 16 | #include "common.h" |
| 17 | #include "executor_address.h" |
| 18 | |
| 19 | // Atexit functions. |
| 20 | ORC_RT_INTERFACE int __orc_rt_macho_cxa_atexit(void (*func)(void *), void *arg, |
| 21 | void *dso_handle); |
| 22 | ORC_RT_INTERFACE void __orc_rt_macho_cxa_finalize(void *dso_handle); |
| 23 | |
| 24 | // dlfcn functions. |
| 25 | ORC_RT_INTERFACE const char *__orc_rt_macho_jit_dlerror(); |
| 26 | ORC_RT_INTERFACE void *__orc_rt_macho_jit_dlopen(const char *path, int mode); |
| 27 | ORC_RT_INTERFACE int __orc_rt_macho_jit_dlupdate(void *dso_handle); |
| 28 | ORC_RT_INTERFACE int __orc_rt_macho_jit_dlclose(void *dso_handle); |
| 29 | ORC_RT_INTERFACE void *__orc_rt_macho_jit_dlsym(void *dso_handle, |
| 30 | const char *symbol); |
| 31 | |
| 32 | namespace orc_rt { |
| 33 | namespace macho { |
| 34 | |
| 35 | enum dlopen_mode : int { |
| 36 | ORC_RT_RTLD_LAZY = 0x1, |
| 37 | ORC_RT_RTLD_NOW = 0x2, |
| 38 | ORC_RT_RTLD_LOCAL = 0x4, |
| 39 | ORC_RT_RTLD_GLOBAL = 0x8 |
| 40 | }; |
| 41 | |
| 42 | } // namespace macho |
| 43 | } // namespace orc_rt |
| 44 | |
| 45 | #endif // ORC_RT_MACHO_PLATFORM_H |
| 46 |
