Reimplement Thread Static Data ASan routines with TLS
authorKamil Rytarowski <n54@gmx.com>
Wed, 19 Dec 2018 11:11:29 +0000 (11:11 +0000)
committerKamil Rytarowski <n54@gmx.com>
Wed, 19 Dec 2018 11:11:29 +0000 (11:11 +0000)
commit342d03e71fbc302cf5a1683dcd03c366bf96d4bb
treef67fb67653b464f22227b6f9dbb1694043ee2772
parentdd67793c0c549638cd93cad1142d324b979ba682
Reimplement Thread Static Data ASan routines with TLS

Summary:
Thread Static Data cannot be used in early init on NetBSD
and FreeBSD. Reuse the ASan TSD API for compatibility with
existing code with an alternative implementation using Thread
Local Storage.

New version uses Thread Local Storage to store a pointer
with thread specific data. The destructor from TSD has been
replaced with a TLS destrucutor that is called upon thread
exit.

Reviewers: joerg, vitalybuka, jfb

Reviewed By: vitalybuka

Subscribers: dim, emaste, ro, jfb, devnexen, kubamracek, mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 349619
compiler-rt/lib/asan/asan_posix.cc