From 6c5497e52717018945c7d7a74229558d81c2825f Mon Sep 17 00:00:00 2001 From: Kyle Brenneman Date: Mon, 3 Oct 2022 08:49:16 -0600 Subject: [PATCH] GLX: Fix assembly stubs for x32 Add x32 assembly stubs for GLX functions. Fixes https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/225 --- src/GLX/glvnd_genentry.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GLX/glvnd_genentry.c b/src/GLX/glvnd_genentry.c index 5a7acfd..aa45e2f 100644 --- a/src/GLX/glvnd_genentry.c +++ b/src/GLX/glvnd_genentry.c @@ -65,9 +65,16 @@ extern char glx_entrypoint_end[]; #elif defined(USE_X86_64_ASM) #define STUB_SIZE 16 + +#if defined(__ILP32__) +#define STUB_ASM_ARCH(slot) \ + "movl (4 * " slot ")+entrypointFunctions(%rip), %eax\n" \ + "jmp *%rax\n" +#else // defined(__ILP32__) #define STUB_ASM_ARCH(slot) \ "movq entrypointFunctions@GOTPCREL(%rip), %rax\n\t" \ "jmp *(8 * " slot ")(%rax)\n" +#endif // defined(__ILP32__) #elif defined(USE_ARMV7_ASM)