summaryrefslogtreecommitdiff
path: root/src/mesa/glapi/gl_x86-64_asm.py
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2006-08-22 16:34:38 +0000
committerIan Romanick <idr@us.ibm.com>2006-08-22 16:34:38 +0000
commit4e4b5f40081cb3e4cefe4dce30712d8d330c0774 (patch)
tree65b722305bb81a0c014903d20cf7d3715fbde83f /src/mesa/glapi/gl_x86-64_asm.py
parent6423ec914530a84ee16977d95b64116e63eca22c (diff)
Add new attribute called static_dispatch to the <function> element. This
boolean attribute, which defaults to true, determines whether or not a static dispatch function is available in libGL for applications to link against. Ideally, any new functions that are not part of the ABI should not have directly accessable dispatch functions. This forces applications to use glXGetProcAddress to access these functions. By doing this we can gracefully remove functions from libGL without breaking the linkage of applications. Note that the static dispatch functions are still generated. However, they are given names like gl_dispatch_stub_820 and are marked with the "hidden" linker attribute. All extension functions added since the previous Mesa release (6.5) have been marked as 'static_dispatch="false"'.
Diffstat (limited to 'src/mesa/glapi/gl_x86-64_asm.py')
-rw-r--r--src/mesa/glapi/gl_x86-64_asm.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py
index ea13d2ac52..eb440009b2 100644
--- a/src/mesa/glapi/gl_x86-64_asm.py
+++ b/src/mesa/glapi/gl_x86-64_asm.py
@@ -236,10 +236,17 @@ class PrintGenericStubs(gl_XML.gl_print_base):
registers.append( ["%rbp", 0] )
+ if f.static_dispatch:
+ name = f.name
+ else:
+ name = "_dispatch_stub_%u" % (f.offset)
+
print '\t.p2align\t4,,15'
- print '\t.globl\tGL_PREFIX(%s)' % (f.name)
- print '\t.type\tGL_PREFIX(%s), @function' % (f.name)
- print 'GL_PREFIX(%s):' % (f.name)
+ print '\t.globl\tGL_PREFIX(%s)' % (name)
+ print '\t.type\tGL_PREFIX(%s), @function' % (name)
+ if not f.static_dispatch:
+ print '\tHIDDEN(GL_PREFIX(%s))' % (name)
+ print 'GL_PREFIX(%s):' % (name)
print '#if defined(GLX_USE_TLS)'
print '\tcall\t_x86_64_get_dispatch@PLT'
print '\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)
@@ -273,7 +280,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
print '\tjmp\t*%r11'
print '#endif /* defined(GLX_USE_TLS) */'
- print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (f.name, f.name)
+ print '\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name)
print ''
return
@@ -284,9 +291,10 @@ class PrintGenericStubs(gl_XML.gl_print_base):
for f in api.functionIterateByOffset():
- for n in f.entry_points:
- if n != f.name:
- print '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, f.name)
+ if f.static_dispatch:
+ for n in f.entry_points:
+ if n != f.name:
+ print '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, f.name)
return