Module Name: xsrc
Committed By: christos
Date: Mon Jan 5 02:46:04 UTC 2015
Modified Files:
xsrc/external/mit/MesaLib/dist/src/mapi: entry_x86_tls.h
entry_x86_tsd.h
Log Message:
fix text relocations.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h \
xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tsd.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h
diff -u xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h:1.1.1.1 xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h:1.2
--- xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h:1.1.1.1 Thu Dec 18 01:02:08 2014
+++ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tls.h Sun Jan 4 21:46:04 2015
@@ -51,10 +51,17 @@ __asm__(".balign 16\n"
".balign 16\n" \
func ":"
+#ifdef __PIC__
+#define STUB_ASM_CODE(slot) \
+ "call x86_current_tls@PLT\n\t"\
+ "movl %gs:(%eax), %eax\n\t" \
+ "jmp *(4 * " slot ")(%eax)"
+#else
#define STUB_ASM_CODE(slot) \
"call x86_current_tls\n\t" \
"movl %gs:(%eax), %eax\n\t" \
"jmp *(4 * " slot ")(%eax)"
+#endif
#define MAPI_TMP_STUB_ASM_GCC
#include "mapi_tmp.h"
Index: xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tsd.h
diff -u xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tsd.h:1.1.1.1 xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tsd.h:1.2
--- xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tsd.h:1.1.1.1 Thu Dec 18 01:02:08 2014
+++ xsrc/external/mit/MesaLib/dist/src/mapi/entry_x86_tsd.h Sun Jan 4 21:46:04 2015
@@ -39,6 +39,16 @@ __asm__(".text\n"
".balign 32\n" \
func ":"
+#ifdef __PIC__
+#define STUB_ASM_CODE(slot) \
+ "movl " ENTRY_CURRENT_TABLE "@PLT, %eax\n\t" \
+ "testl %eax, %eax\n\t" \
+ "je 1f\n\t" \
+ "jmp *(4 * " slot ")(%eax)\n" \
+ "1:\n\t" \
+ "call " ENTRY_CURRENT_TABLE_GET "@PLT\n\t" \
+ "jmp *(4 * " slot ")(%eax)"
+#else
#define STUB_ASM_CODE(slot) \
"movl " ENTRY_CURRENT_TABLE ", %eax\n\t" \
"testl %eax, %eax\n\t" \
@@ -47,6 +57,7 @@ __asm__(".text\n"
"1:\n\t" \
"call " ENTRY_CURRENT_TABLE_GET "\n\t" \
"jmp *(4 * " slot ")(%eax)"
+#endif
#define MAPI_TMP_STUB_ASM_GCC
#include "mapi_tmp.h"