[all-commits] [llvm/llvm-project] 1e33c7: [clang][MinGW] Add asan DLL lib before other libs ...

alvinhochun via All-commits all-commits at lists.llvm.org
Mon Apr 3 21:49:53 PDT 2023


  Branch: refs/heads/release/16.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e33c7482b457e49542135cd8b92666bd603a415
      https://github.com/llvm/llvm-project/commit/1e33c7482b457e49542135cd8b92666bd603a415
  Author: Alvin Wong <alvin at alvinhc.com>
  Date:   2023-04-03 (Mon, 03 Apr 2023)

  Changed paths:
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M clang/test/Driver/mingw-sanitizers.c

  Log Message:
  -----------
  [clang][MinGW] Add asan DLL lib before other libs and objects

As stated in https://github.com/llvm/llvm-project/issues/61685, by
passing LLD the import lib of the asan DLL first, the asan DLL will be
listed as the first entry in the Import Directory Table, making it be
loaded first before other user DLLs. This allows asan to be initialized
as early as possible to increase its instrumentation coverage to include
other DLLs not built with asan.

This also avoids some false asan reports on `realloc` for memory
allocated during initialization of user DLLs being loaded earlier than
asan, because after this change they will be loaded later than asan.

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

(cherry picked from commit 81358e9193a9282372c145b63042b2852d3afa18)




More information about the All-commits mailing list