Skip to content

Commit

Permalink
Merge pull request #16797 from albap/patch-1
Browse files Browse the repository at this point in the history
Fix portability issue
  • Loading branch information
yuyichao committed Jun 7, 2016
2 parents 7fed6b0 + dbe89b2 commit b396b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,15 +853,15 @@ bool jl_dylib_DI_for_fptr(size_t pointer, const llvm::object::ObjectFile **obj,
Dl_info dlinfo;
int dladdr_success;
uint64_t fbase;
#ifdef _OS_LINUX_
#ifdef __GLIBC__
struct link_map *extra_info;
dladdr_success = dladdr1((void*)pointer, &dlinfo, (void**)&extra_info, RTLD_DL_LINKMAP) != 0;
#else
dladdr_success = dladdr((void*)pointer, &dlinfo) != 0;
#endif

if (dladdr_success && dlinfo.dli_fname) {
#ifdef _OS_LINUX_
#ifdef __GLIBC__
// dlinfo.dli_fbase is not the right value for the main executable on linux
fbase = (uintptr_t)extra_info->l_addr;
#else
Expand Down

0 comments on commit b396b4d

Please sign in to comment.