diff options
author | Rui Ueyama <ruiu@google.com> | 2014-09-18 02:02:52 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2014-09-18 02:02:52 +0000 |
commit | 9f1215b2d8f17879d930ececc565f34d9689c56d (patch) | |
tree | d19f9d4499b2937bb4f2ddabf6ef9372df616b74 /clang/lib/Basic/Targets.cpp | |
parent | d8e366ba196e8f38f55f8e1da8501b8f9e4dfd89 (diff) | |
download | bcm5719-llvm-9f1215b2d8f17879d930ececc565f34d9689c56d.tar.gz bcm5719-llvm-9f1215b2d8f17879d930ececc565f34d9689c56d.zip |
[PECOFF] Support TLS callbacks.
The contents from section .CRT$XLA to .CRT$XLZ is an array of function
pointers. They are called by the runtime when a new thread is created
or (gracefully) terminated.
You can make your own initialization function to be called by that
mechanism. All you have to do is:
- Define a pointer to a function in a .CRT$XL* section using pragma
- Make an external reference to "__tls_used" symbol
That technique is used in many projects. This patch is to support that.
What this patch does is to set the relative virtual address of
"__tls_used" to the PECOFF directory table. __tls_used is actually a
struct containing pointers to a symbol in .CRT$XLA and another symbol
in .CRT$XLZ. The runtime looks at the directory table, gets the address
of the struct, and call the function pointers between XLA and XLZ.
llvm-svn: 218007
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
0 files changed, 0 insertions, 0 deletions