From 3e1caf5d2666ed220f4a740db4fe5a7ad54e455a Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Wed, 8 Jun 2011 15:50:25 +0200 Subject: [PATCH] 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 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h index d3b606c8ac5..72d4125a694 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); } -- 2.30.2