Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-02-19 20:38:22 +0300
committerJan Kotas <jkotas@microsoft.com>2016-02-19 20:38:22 +0300
commita07f7734d1a3d72b3188e54a7180ecb5519d1aa0 (patch)
tree44db222555c0140e6f2c51f6f8b728450a2aded8 /src/Native/Runtime/threadstore.cpp
parent2171677443cabd01f94293e17380e05e0d776b44 (diff)
Use RhpGetThread helper in ExceptionHandling.asm
The inline TLS access in Windows assembly code depends on hardcoded TLS offset. The hardcoded offset does not work well for static linking used by CoreRT because of it can be anything depending on what other thread local variables got linked in. I have changed the TLS access in ExceptionHandling.asm where it is causing problem right now to call the RhpGetThread instead.
Diffstat (limited to 'src/Native/Runtime/threadstore.cpp')
-rw-r--r--src/Native/Runtime/threadstore.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Native/Runtime/threadstore.cpp b/src/Native/Runtime/threadstore.cpp
index 73048cd2e..a1b639206 100644
--- a/src/Native/Runtime/threadstore.cpp
+++ b/src/Native/Runtime/threadstore.cpp
@@ -322,14 +322,19 @@ DECLSPEC_THREAD ThreadBuffer tls_CurrentThread =
0, // m_uPalThreadId
};
+#ifdef CORERT
+Thread * FASTCALL RhpGetThread()
+{
+ return (Thread *)&tls_CurrentThread;
+}
+#endif
+
// static
void * ThreadStore::CreateCurrentThreadBuffer()
{
void * pvBuffer = &tls_CurrentThread;
-#if !defined(CORERT) // @TODO: CORERT: No assembly routine defined to verify against.
ASSERT(RhpGetThread() == pvBuffer);
-#endif // !defined(CORERT)
return pvBuffer;
}