[PATCH] D29229: [compiler-rt] Fix tests for the exported interface on Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 12:48:52 PST 2017


mpividori created this revision.
Herald added a subscriber: dberris.

In this diff I fix the test in `dll_host`, and update it to work with the new "sanitizer_interface.inc" files.
I check the interfaces for MD and MT.

For MT, the sanitizer rt is included in a static library, which exports the main interface. Other dlls use interception to access to the sanitizer rt that resides in the main executable (implemented in dll_thunk).

-------------

To ensure that the main executable exports ALL the sanitizers's functions, we need to make sure that all object files from the static library are linked to the main executable, so we need to add the flag `-wholearchive` to clang driver, when including the static version of asan. I will add these changes in a new diff.

If we don't include `-wholearchive` , the linker could omit some object files when they don't resolve any symbol for the main executable.
But instrumented dlls will try to access to all the interface exposed by the main executable. If we omit part of it, the initialization in `dll_thunk` will fail.


https://reviews.llvm.org/D29229

Files:
  test/asan/TestCases/Windows/check_interface_md.cc
  test/asan/TestCases/Windows/check_interface_mt.cc
  test/asan/TestCases/Windows/dll_host.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29229.86100.patch
Type: text/x-patch
Size: 8903 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170127/9e6514f6/attachment.bin>


More information about the llvm-commits mailing list