[all-commits] [llvm/llvm-project] 52f2df: [Sanitizers] Get link map on FreeBSD and NetBSD vi...

Dimitry Andric via All-commits all-commits at lists.llvm.org
Mon Feb 10 14:43:39 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 52f2df1ecdd79cc550b694ab280f3b0396d7cf9a
      https://github.com/llvm/llvm-project/commit/52f2df1ecdd79cc550b694ab280f3b0396d7cf9a
  Author: Dimitry Andric <dimitry at andric.com>
  Date:   2020-02-10 (Mon, 10 Feb 2020)

  Changed paths:
    M compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_libc.h
    M compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_netbsd.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_freebsd.h
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.h
    M compiler-rt/lib/sanitizer_common/sanitizer_rtems.cpp
    M compiler-rt/lib/sanitizer_common/sanitizer_win.cpp

  Log Message:
  -----------
  [Sanitizers] Get link map on FreeBSD and NetBSD via documented API

Summary:
Instead of hand-crafting an offset into the structure returned by
dlopen(3) to get at the link map, use the documented API.  This is
described in dlinfo(3): by calling it with `RTLD_DI_LINKMAP`, the
dynamic linker ensures the right address is returned.

This is a recommit of 92e267a94dc4272511be674062f8a3e8897b7083, with
dlinfo(3) expliclity being referenced only for FreeBSD, non-Android
Linux, NetBSD and Solaris.  Other OSes will have to add their own
implementation.

Reviewers: devnexen, emaste, MaskRay, krytarowski

Reviewed By: krytarowski

Subscribers: krytarowski, vitalybuka, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73990




More information about the All-commits mailing list