diff --git a/renderdoc/3rdparty/plthook/plthook_elf.c b/renderdoc/3rdparty/plthook/plthook_elf.c index 612f689d6..907e7f63e 100644 --- a/renderdoc/3rdparty/plthook/plthook_elf.c +++ b/renderdoc/3rdparty/plthook/plthook_elf.c @@ -233,7 +233,11 @@ int plthook_open_by_address(plthook_t **plthook_out, void *address) struct link_map *lmap = NULL; *plthook_out = NULL; +#ifdef __GLIBC__ if (dladdr1(address, &info, (void**)&lmap, RTLD_DL_LINKMAP) == 0) { +#else + if (dladdr(address, &info) == 0) { +#endif set_errmsg("dladdr error"); return PLTHOOK_FILE_NOT_FOUND; } @@ -243,7 +247,7 @@ int plthook_open_by_address(plthook_t **plthook_out, void *address) static int plthook_open_executable(plthook_t **plthook_out) { -#if defined __linux__ +#if defined __linux__ && defined __GLIBC__ return plthook_open_real(plthook_out, _r_debug.r_map); #elif defined __sun const char *auxv_file = "/proc/self/auxv"; diff --git a/renderdoc/os/os_specific.h b/renderdoc/os/os_specific.h index cc9a6b09e..844597450 100644 --- a/renderdoc/os/os_specific.h +++ b/renderdoc/os/os_specific.h @@ -31,6 +31,7 @@ #pragma once +#include #include #include #include diff --git a/renderdoc/os/posix/linux/linux_hook.cpp b/renderdoc/os/posix/linux/linux_hook.cpp index 4989e2865..0acb3ac0b 100644 --- a/renderdoc/os/posix/linux/linux_hook.cpp +++ b/renderdoc/os/posix/linux/linux_hook.cpp @@ -36,6 +36,10 @@ #include "plthook/plthook.h" #include "strings/string_utils.h" +#ifndef __GLIBC__ +#define RTLD_DEEPBIND 0 +#endif + Threading::CriticalSection libLock; RDOC_EXTERN_CONFIG(bool, Linux_Debug_PtraceLogging);