diff options
| author | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2015-01-30 12:43:52 +0000 |
|---|---|---|
| committer | Viktor Kutuzov <vkutuzov@accesssoftek.com> | 2015-01-30 12:43:52 +0000 |
| commit | 07e6c0017163097a6c70c3ab4e3aab0e6c0e21ef (patch) | |
| tree | af71008e1aa366fbfbc3db9f61a18d9dba51c283 /compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | |
| parent | c897af3ffc05d2ebe5df0a162116525835e23e60 (diff) | |
| download | bcm5719-llvm-07e6c0017163097a6c70c3ab4e3aab0e6c0e21ef.tar.gz bcm5719-llvm-07e6c0017163097a6c70c3ab4e3aab0e6c0e21ef.zip | |
[Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macro
Differential Revision: http://reviews.llvm.org/D7233
llvm-svn: 227570
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h index e7c20e2ffac..d375e01a20e 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h @@ -18,6 +18,15 @@ #include "sanitizer_internal_defs.h" #include "sanitizer_platform.h" +#if SANITIZER_FREEBSD +// FreeBSD's dlopen() returns a pointer to an Obj_Entry structure that +// incroporates the map structure. +# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \ + ((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 544))) +#else +# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) ((link_map*)(handle)) +#endif // !SANITIZER_FREEBSD + namespace __sanitizer { extern unsigned struct_utsname_sz; extern unsigned struct_stat_sz; |

