[PATCH] D72272: [Sanitizers] Elf mapping update of FreeBSD offset

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 11:29:42 PST 2020


dim 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
----------------
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?



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