llvm-project/compiler-rt
Kamil Rytarowski 4a282024db Correct atexit(3) support in MSan/NetBSD
Summary:
The NetBSD specific implementation of cxa_atexit() does not
preserve the 2nd argument if dso is equal to NULL.

Changes:

 - Split paths of handling intercepted __cxa_atexit() and atexit(3).
   This affects all supported Operating Systems.
 - Add a local stack-like structure to hold the __cxa_atexit() context.
   atexit(3) is documented in the C standard as calling callback from the
   earliest to the oldest entry. This path also fixes potential ABI
   problem of passing an argument to a function from the atexit(3)
   callback mechanism.
 - Allow usage of global vars with ctors in interceptors.
   This allows to use Vector without automatic cleaning up the structures.

This code has been modeled after TSan implementation for the same functions.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dvyukov, eugenis, vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: delcypher, devnexen, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 346579
2018-11-10 02:17:32 +00:00
..
cmake [compiler-rt] Support for passing through linker flags to libc++ build 2018-11-03 01:38:26 +00:00
docs [sanitizers] Make it possible to XFAIL on the effective target, not just the default. 2016-08-09 11:50:53 +00:00
include Regenerate syscall hooks for NetBSD 8.99.25 2018-10-30 11:10:36 +00:00
lib Correct atexit(3) support in MSan/NetBSD 2018-11-10 02:17:32 +00:00
test Re-land r343606 "[winasan] Unpoison the stack in NtTerminateThread" 2018-11-09 22:06:59 +00:00
unittests [XRay] Add LD_LIBRARY_PATH to env variables for Unit Tests 2018-09-27 23:15:05 +00:00
utils Update generate_netbsd_ioctls.awk for NetBSD 8.99.25 2018-10-31 12:52:08 +00:00
www
.arcconfig [compiler-rt] Set up .arcconfig to point to new Diffusion CRT repository 2017-12-06 20:55:32 +00:00
.gitignore Add .pyc files to .gitignore to compiler-rt 2017-07-24 21:51:12 +00:00
CMakeLists.txt [CMake] When built with LLVM, not use `-Wl,-z,defs` 2018-10-29 22:16:56 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
README.txt

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================