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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoão Matos <joao@tritao.eu>2015-12-01 18:48:28 +0300
committerJoão Matos <joao@tritao.eu>2015-12-01 18:48:28 +0300
commita9a3283ba0746791d3faebe2aa06df16f9d4c762 (patch)
tree9af1081ef642cfb2f95297eb87a88ee607afe682
parent1f31596364233b78242321bd71d42c8967415d43 (diff)
parent7370e2fd217483b8d9dc01b82c94f5d14c4f900f (diff)
Merge pull request #2205 from ThesaurusSoftware/mono-4.0.0-el-capitan-Xcodemono-4.0.0-branch
Let Mono live with Xcode on EL Capitan.
-rwxr-xr-xmono/mini/mini-amd64.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c
index 29336f277da..0c4c05a33aa 100755
--- a/mono/mini/mini-amd64.c
+++ b/mono/mini/mini-amd64.c
@@ -3579,6 +3579,35 @@ mono_amd64_have_tls_get (void)
tls_gs_offset = ins[5];
+ /*
+ * Apple now loads a different version of pthread_getspecific when launched from Xcode
+ * For that version we're looking for these instructions:
+ *
+ * pushq %rbp
+ * movq %rsp, %rbp
+ * mov %gs:[offset](,%rdi,8),%rax
+ * popq %rbp
+ * retq
+ */
+ if (!have_tls_get) {
+ have_tls_get = ins [0] == 0x55 &&
+ ins [1] == 0x48 &&
+ ins [2] == 0x89 &&
+ ins [3] == 0xe5 &&
+ ins [4] == 0x65 &&
+ ins [5] == 0x48 &&
+ ins [6] == 0x8b &&
+ ins [7] == 0x04 &&
+ ins [8] == 0xfd &&
+ ins [10] == 0x00 &&
+ ins [11] == 0x00 &&
+ ins [12] == 0x00 &&
+ ins [13] == 0x5d &&
+ ins [14] == 0xc3;
+
+ tls_gs_offset = ins[9];
+ }
+
return have_tls_get;
#elif defined(TARGET_ANDROID)
return FALSE;