summaryrefslogtreecommitdiff
path: root/src/mapi/mapi/entry_x86-64_tls.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapi/mapi/entry_x86-64_tls.h')
-rw-r--r--src/mapi/mapi/entry_x86-64_tls.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h
index 2fbe73b5b3..2c02933802 100644
--- a/src/mapi/mapi/entry_x86-64_tls.h
+++ b/src/mapi/mapi/entry_x86-64_tls.h
@@ -30,10 +30,23 @@
#include "u_execmem.h"
#include "u_macros.h"
+#ifdef __linux__
+__asm__(".section .note.ABI-tag, \"a\"\n\t"
+ ".p2align 2\n\t"
+ ".long 1f - 0f\n\t" /* name length */
+ ".long 3f - 2f\n\t" /* data length */
+ ".long 1\n\t" /* note length */
+ "0: .asciz \"GNU\"\n\t" /* vendor name */
+ "1: .p2align 2\n\t"
+ "2: .long 0\n\t" /* note data: the ABI tag */
+ ".long 2,4,20\n\t" /* Minimum kernel version w/TLS */
+ "3: .p2align 2\n\t"); /* pad out section */
+#endif /* __linux__ */
+
__asm__(".text");
__asm__("x86_64_current_tls:\n\t"
- "movq u_current_table_tls@GOTTPOFF(%rip), %rax\n\t"
+ "movq u_current_table@GOTTPOFF(%rip), %rax\n\t"
"ret");
#define STUB_ASM_ENTRY(func) \
@@ -43,7 +56,7 @@ __asm__("x86_64_current_tls:\n\t"
func ":"
#define STUB_ASM_CODE(slot) \
- "movq u_current_table_tls@GOTTPOFF(%rip), %rax\n\t" \
+ "movq u_current_table@GOTTPOFF(%rip), %rax\n\t" \
"movq %fs:(%rax), %r11\n\t" \
"jmp *(8 * " slot ")(%r11)"