[Mesa-dev] [PATCH] mapi: Fix tls with shared/es-glapi on x86-64

Chia-I Wu olvaffe at gmail.com
Tue Jun 7 14:57:58 PDT 2011


On Wed, Jun 8, 2011 at 2:33 AM, Benjamin Franzke
<benjaminfranzke at googlemail.com> wrote:
> x86_64_entry_start needs to be bound global, in order to have the
> correct address in entry_get_public (seems not to be needed on x86).
>
> Otherwise addresses needed for _glapi_proc_address will be computed
> from some random offset (0x6400229a61058b48 in my case).
How is that the case?  It seems the symbol is not used elsewhere.

I don't have a x86-64 machine to verify at the moment.

> ---
>  src/mapi/mapi/entry_x86-64_tls.h |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h
> index d3b606c..dad596a 100644
> --- a/src/mapi/mapi/entry_x86-64_tls.h
> +++ b/src/mapi/mapi/entry_x86-64_tls.h
> @@ -28,6 +28,12 @@
>
>  #include "u_macros.h"
>
> +#ifdef __GNUC__
> +#  define HIDDEN(x) ".hidden " U_STRINGIFY(x) "\n"
> +#else
> +#  define HIDDEN(x)
> +#endif
> +
>  #ifdef __linux__
>  __asm__(".section .note.ABI-tag, \"a\"\n\t"
>         ".p2align 2\n\t"
> @@ -43,6 +49,8 @@ __asm__(".section .note.ABI-tag, \"a\"\n\t"
>
>  __asm__(".text\n"
>         ".balign 32\n"
> +        ".globl x86_64_entry_start\n"
> +        HIDDEN(x86_64_entry_start)
>         "x86_64_entry_start:");
>
>  #define STUB_ASM_ENTRY(func)                             \
> --
> 1.7.3.4
>
>



-- 
olv at LunarG.com


More information about the mesa-dev mailing list