summaryrefslogtreecommitdiffstats
path: root/src/mapi
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-12-17 03:11:53 +0800
committerChia-I Wu <[email protected]>2010-12-18 14:46:10 +0800
commitc7119e281b21bcfc88e5fdce2a5d8ebdbf6c6b62 (patch)
tree1b690ecec8b6bddb23d95c78be3b7417f9319d31 /src/mapi
parenta954dbeb8c422a6a800b77d5ded76c92eebde1a8 (diff)
mapi: Add ABI-tag note.
TLS requires kernel >= 2.4.20. Per glapi.
Diffstat (limited to 'src/mapi')
-rw-r--r--src/mapi/mapi/entry_x86-64_tls.h13
-rw-r--r--src/mapi/mapi/entry_x86_tls.h13
2 files changed, 26 insertions, 0 deletions
diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h
index 2fbe73b5b32..cc3d5a8d7ea 100644
--- a/src/mapi/mapi/entry_x86-64_tls.h
+++ b/src/mapi/mapi/entry_x86-64_tls.h
@@ -30,6 +30,19 @@
#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"
diff --git a/src/mapi/mapi/entry_x86_tls.h b/src/mapi/mapi/entry_x86_tls.h
index d4f7d98cf12..9a1f6e4ec4b 100644
--- a/src/mapi/mapi/entry_x86_tls.h
+++ b/src/mapi/mapi/entry_x86_tls.h
@@ -30,6 +30,19 @@
#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_current_tls:\n\t"