diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py index 2fa140d..11cd9af 100644 --- a/src/mapi/glapi/gen/gl_x86-64_asm.py +++ b/src/mapi/glapi/gen/gl_x86-64_asm.py @@ -166,7 +166,8 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '' print '\t.p2align\t4,,15' print '_x86_64_get_dispatch:' - print '\tmovq\t_gl_DispatchTSD(%rip), %rdi' + print '\tmovq\t_gl_DispatchTSD@GOTPCREL(%rip), %rax' + print '\tmovl\t(%rax), %edi' print '\tjmp\tpthread_getspecific@PLT' print '' print '#elif defined(THREADS)' diff --git a/src/mapi/glapi/glapi_x86-64.S b/src/mapi/glapi/glapi_x86-64.S index 469fac3..c42646f 100644 --- a/src/mapi/glapi/glapi_x86-64.S +++ b/src/mapi/glapi/glapi_x86-64.S @@ -73,7 +73,8 @@ _x86_64_get_dispatch: .p2align 4,,15 _x86_64_get_dispatch: - movq _gl_DispatchTSD(%rip), %rdi + movq _gl_DispatchTSD@GOTPCREL(%rip), %rax + movl (%rax), %edi jmp pthread_getspecific@PLT #elif defined(THREADS)