Try to find `dlopen`/`dlsym` from libc.so too (musl libc, glibc 2.34+)

pull/609/head
jackun 3 years ago
parent cd43374102
commit ced84ec526
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -18,19 +18,26 @@ static bool print_dlsym = getenv("MANGOHUD_DEBUG_DLSYM") != nullptr;
void get_real_functions()
{
eh_obj_t libdl;
int ret;
if (eh_find_obj(&libdl, "*libdl.so*")) {
fprintf(stderr, "can't get libdl.so\n");
#if defined(__GLIBC__)
ret = eh_find_obj(&libdl, "*libdl.so*");
if (ret)
#endif
ret = eh_find_obj(&libdl, "*libc.so*"); // musl, glibc 2.34+
if (ret) {
fprintf(stderr, "MANGOHUD: Cannot find libdl.so and libc.so\n");
exit(1);
}
if (eh_find_sym(&libdl, "dlopen", (void **) &__dlopen)) {
fprintf(stderr, "can't get dlopen()\n");
fprintf(stderr, "MANGOHUD: Can't get dlopen()\n");
exit(1);
}
if (eh_find_sym(&libdl, "dlsym", (void **) &__dlsym)) {
fprintf(stderr, "can't get dlsym()\n");
fprintf(stderr, "MANGOHUD: Can't get dlsym()\n");
exit(1);
}

Loading…
Cancel
Save