Mesa (master): mapi: Fix tls with shared/es-glapi on x86-64

Chia-I Wu olv at kemper.freedesktop.org
Mon Jun 13 04:20:26 UTC 2011


Module: Mesa
Branch: master
Commit: 3e1caf5d2666ed220f4a740db4fe5a7ad54e455a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e1caf5d2666ed220f4a740db4fe5a7ad54e455a

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Wed Jun  8 15:50:25 2011 +0200

mapi: Fix tls with shared/es-glapi on x86-64

x86_64_entry_start needs to be declared static in the C code,
in order to have the correct address in entry_get_public
(seems not to be needed on x86).

The compiler needs to lookup a local not a global object.

Otherwise addresses needed for _glapi_proc_address will be computed
from some random offset (0x6400229a61058b48 in my case).

---

 src/mapi/mapi/entry_x86-64_tls.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h
index d3b606c..72d4125 100644
--- a/src/mapi/mapi/entry_x86-64_tls.h
+++ b/src/mapi/mapi/entry_x86-64_tls.h
@@ -76,10 +76,12 @@ entry_patch_public(void)
 {
 }
 
+static char
+x86_64_entry_start[];
+
 mapi_func
 entry_get_public(int slot)
 {
-   extern char x86_64_entry_start[];
    return (mapi_func) (x86_64_entry_start + slot * 32);
 }
 




More information about the mesa-commit mailing list