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-04-29 21:47:46 +0300
committerJan Kotas <jkotas@microsoft.com>2016-04-29 21:47:46 +0300
commita7eb0f0c3704f1666f8f0985158f557bf0ea8ac5 (patch)
treef5e9d49d32771cbcea97300b6c68c18da9dbe90d /src/Native/Runtime/i386
parentede47337e4736cda31f963e1dacaf38f1d09e2f5 (diff)
Use SECREL relocs for TLS offset in asm code
This avoids hardcoded offsets that are incompatible with static linking and otherwise fragile. [tfs-changeset: 1600424]
Diffstat (limited to 'src/Native/Runtime/i386')
-rw-r--r--src/Native/Runtime/i386/AsmMacros.inc10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Native/Runtime/i386/AsmMacros.inc b/src/Native/Runtime/i386/AsmMacros.inc
index 1bec2c7af..150d68049 100644
--- a/src/Native/Runtime/i386/AsmMacros.inc
+++ b/src/Native/Runtime/i386/AsmMacros.inc
@@ -43,11 +43,12 @@ __tls_array equ 2Ch ;; offsetof(TEB, ThreadLocalStoragePointer)
INLINE_GETTHREAD macro destReg, trashReg
ASSUME fs : NOTHING
EXTERN __tls_index : DWORD
+ EXTERN _tls_CurrentThread : DWORD
mov destReg, [__tls_index]
mov trashReg, fs:[__tls_array]
mov destReg, [trashReg + destReg * 4]
- add destReg, OFFSETOF__TLS__tls_CurrentThread
+ add destReg, SECTIONREL _tls_CurrentThread
endm
@@ -150,13 +151,6 @@ PTFF_RAX_IS_BYREF equ 00020000h ;; iff PTFF_SAVE_RAX: set -> eax is ByRe
;;
MANAGED_CALLOUT_THUNK_TRANSITION_FRAME_POINTER_OFFSET equ -4
-ifndef CORERT ; Hardcoded TLS offsets are not compatible with static linking
-;;
-;; This constant, unfortunately, cannot be validated at build time.
-;;
-OFFSETOF__TLS__tls_CurrentThread equ 8h
-endif
-
;;
;; Rename fields of nested structs
;;