[PATCH] D72272: [Sanitizers] Elf mapping update of FreeBSD offset
Evgenii Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 11:39:01 PST 2020
eugenis added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h:27
# define GET_LINK_MAP_BY_DLOPEN_HANDLE(handle) \
- ((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 560)))
+ ((link_map*)((handle) == nullptr ? nullptr : ((char*)(handle) + 568)))
// Get sys/_types.h, because that tells us whether 64-bit inodes are
----------------
dim wrote:
> MaskRay wrote:
> > Can you use `offsetof` instead of the magic number? In the description you can add a reference to the commit that causes the change.
> Ideally we shouldn't include any system headers here, right? Otherwise it is not possible to use offsetof, and we should choose the value based on e.g. `__FreeBSD_version`. @emaste any thoughts?
>
If you'd like, you could include a system header in the corresponding .cpp file, store the offset value in a global and use that global in this macro.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72272/new/
https://reviews.llvm.org/D72272
More information about the llvm-commits
mailing list