Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
[asan] re-enable __tls_get_addr interceptor with a proper fix (use __…
Browse files Browse the repository at this point in the history
…attribute__((tls_model(initial-exec))))

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@200463 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kcc committed Jan 30, 2014
1 parent a16424e commit 2ea4365
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions lib/asan/lit_tests/TestCases/Linux/stress_dtls.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Currently broken...
// XFAIL: *
// REQUIRES: asan-64-bits
// Stress test dynamic TLS + dlopen + threads.
//
Expand Down
2 changes: 1 addition & 1 deletion lib/sanitizer_common/sanitizer_platform_interceptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@
#define SANITIZER_INTERCEPT_PTHREAD_COND SI_NOT_WINDOWS
#define SANITIZER_INTERCEPT_PTHREAD_SETNAME_NP SI_LINUX_NOT_ANDROID

#define SANITIZER_INTERCEPT_TLS_GET_ADDR 0 // SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_TLS_GET_ADDR SI_LINUX_NOT_ANDROID

#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
4 changes: 2 additions & 2 deletions lib/sanitizer_common/sanitizer_tls_get_addr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ struct Glibc_2_19_tls_header {
uptr start;
};

// This must be static TLS, i.e. the run-time should be build with
// -ftls-model=initial-exec or equivalent.
// This must be static TLS
__attribute__((tls_model("initial-exec")))
static __thread DTLS dtls;

// Make sure we properly destroy the DTLS objects:
Expand Down

0 comments on commit 2ea4365

Please sign in to comment.