Elliott Hughes | 13da600 | 2025-02-03 10:42:13 -0800 | [diff] [blame] | 1 | // Copyright (C) 2017 The Android Open Source Project |
| 2 | // SPDX-License-Identifier: BSD-2-Clause |
Elliott Hughes | 21b56eb | 2017-10-20 17:57:17 -0700 | [diff] [blame] | 3 | |
| 4 | #include <dlfcn.h> |
| 5 | |
| 6 | #include "header_checks.h" |
| 7 | |
| 8 | static void dlfcn_h() { |
| 9 | MACRO(RTLD_LAZY); |
| 10 | MACRO(RTLD_NOW); |
| 11 | MACRO(RTLD_GLOBAL); |
| 12 | MACRO(RTLD_LOCAL); |
| 13 | |
Elliott Hughes | f4d57ac | 2025-01-28 14:22:12 -0800 | [diff] [blame] | 14 | #if !defined(__GLIBC__) // Our glibc is too old. |
| 15 | TYPE(Dl_info); |
| 16 | STRUCT_MEMBER(Dl_info, const char*, dli_fname); |
| 17 | STRUCT_MEMBER(Dl_info, void*, dli_fbase); |
| 18 | STRUCT_MEMBER(Dl_info, const char*, dli_sname); |
| 19 | STRUCT_MEMBER(Dl_info, void*, dli_saddr); |
| 20 | #endif |
| 21 | |
| 22 | #if !defined(__GLIBC__) // Our glibc is too old. |
| 23 | FUNCTION(dladdr, int (*f)(const void*, Dl_info*)); |
| 24 | #endif |
Elliott Hughes | 21b56eb | 2017-10-20 17:57:17 -0700 | [diff] [blame] | 25 | FUNCTION(dlclose, int (*f)(void*)); |
| 26 | FUNCTION(dlerror, char* (*f)(void)); |
| 27 | FUNCTION(dlopen, void* (*f)(const char*, int)); |
| 28 | FUNCTION(dlsym, void* (*f)(void*, const char*)); |
| 29 | } |