glapi: add @GOTPCREL relocation type
authorDimitry Andric <dimitry@andric.com>
Fri, 28 Jan 2011 01:03:42 +0000 (18:03 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 28 Jan 2011 01:04:57 +0000 (18:04 -0700)
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=33440
This replaces commit 731ec60da3ccb92f5bfb4d6f1bc3c8e712751376

NOTE: This is a candidate for the 7.9 and 7.10 branches

Signed-off-by: Brian Paul <brianp@vmware.com>
src/mapi/glapi/gen/gl_x86-64_asm.py
src/mapi/glapi/glapi_x86-64.S

index 2fa140dc308c3de7b6517226db6c9be4bfad806e..11cd9af40618dbd075d95fd70da64679a04c8ec2 100644 (file)
@@ -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)'
index 469fac31ae6be26a19da3c7ab28f4d9bdeab6c16..c42646f0165d116275d440f75f3776d0fde153fc 100644 (file)
@@ -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)