Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 118044 Details for
Bug 136115
media-libs/mesa-6.5-r3: libGL not built PIC?
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
No more TEXTREL for libGL on x86 v3
6.5.2-no-textrel-tls-x86.patch (text/plain), 2.17 KB, created by
Joakim Tjernlund
on 2007-05-03 13:48:24 UTC
(
hide
)
Description:
No more TEXTREL for libGL on x86 v3
Filename:
MIME Type:
Creator:
Joakim Tjernlund
Created:
2007-05-03 13:48:24 UTC
Size:
2.17 KB
patch
obsolete
>--- ./src/mesa/glapi/glapi.c.org 2007-05-02 13:33:59.000000000 +0200 >+++ ./src/mesa/glapi/glapi.c 2007-05-03 15:43:02.000000000 +0200 >@@ -1035,14 +1035,17 @@ > static void > init_glapi_relocs( void ) > { >-#if defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) >- extern void * _x86_get_dispatch(void); >- const GLubyte * const get_disp = (const GLubyte *) _x86_get_dispatch; >+#if defined( USE_X86_ASM ) && defined( GLX_USE_TLS )\ >+ && !defined( GLX_X86_READONLY_TEXT ) >+ extern unsigned long _x86_get_dispatch(void); >+ char run_time_patch[] = {0x65, 0xa1, 0, 0, 0, 0};/* movl %gs:0,%eax */ >+ unsigned long *offset = (unsigned long *) &run_time_patch[2]; >+ const GLubyte * const get_disp = (const GLubyte *) run_time_patch; > GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; > >- >+ *offset = _x86_get_dispatch(); > while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { >- (void) memcpy( curr_func, get_disp, 6 ); >+ (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); > curr_func += DISPATCH_FUNCTION_SIZE; > } > #endif /* defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) */ >--- ./src/mesa/x86/glapi_x86.S.org 2007-04-28 16:21:10.000000000 +0200 >+++ ./src/mesa/x86/glapi_x86.S 2007-05-03 10:07:01.000000000 +0200 >@@ -58,12 +58,17 @@ > > #ifdef GLX_USE_TLS > >+#ifdef GLX_X86_READONLY_TEXT >+# define CTX_INSNS MOV_L(GS:(EAX), EAX) >+#else >+# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */ >+#endif > # define GL_STUB(fn,off,fn_alt) \ > ALIGNTEXT16; \ > GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ > GL_PREFIX(fn, fn_alt): \ > CALL(_x86_get_dispatch) ; \ >- NOP ; \ >+ CTX_INSNS ; \ > JMP(GL_OFFSET(off)) > > #elif defined(PTHREADS) >@@ -114,7 +119,10 @@ > HIDDEN(GLNAME(_x86_get_dispatch)) > ALIGNTEXT16 > GLNAME(_x86_get_dispatch): >- movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax >+ call 1f >+1: popl %eax >+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax >+ movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax > ret > > #elif defined(PTHREADS) >@@ -133,7 +141,7 @@ > EXTERN GLNAME(_glapi_get_dispatch) > #endif > >-#if defined( GLX_USE_TLS ) >+#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT ) > .section wtext, "awx", @progbits > #endif /* defined( GLX_USE_TLS ) */ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 136115
:
117970
|
118024
| 118044