]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
cpuid_query: use %ebx in a way that doesn't confuse PIC mode in some
authorRhys Weatherley <rweather@southern-storm.com.au>
Mon, 16 Aug 2004 06:45:03 +0000 (06:45 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Mon, 16 Aug 2004 06:45:03 +0000 (06:45 +0000)
versions of gcc (bug #10022).

ChangeLog
jit/jit-cpuid-x86.c

index feb63fc5cbc4f5f61a5bcb3245f956474a56c353..e9477b1ee960063600849f3886b39d1ce571ef43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 
+2004-08-16  Rhys Weatherley  <rweather@southern-storm.com.au>
+
+       * jit/jit-cpuid-x86.c (cpuid_query): use %ebx in a way that doesn't
+       confuse PIC mode in some versions of gcc (bug #10022).
+
 2004-08-13  Rhys Weatherley  <rweather@southern-storm.com.au>
 
        * include/jit/jit-insn.h, include/jit/jit-opcode.h,
index 03b0e62991df57474e5f787dc44d7a8c842bc3e4..b0609914a90245c20ceb1c51694ee7a6d36ae86f 100644 (file)
@@ -58,6 +58,7 @@ static void cpuid_query(unsigned int index, jit_cpuid_x86_t *info)
 #if defined(__GNUC__)
        __asm__ __volatile__ (
                "\tmovl %0, %%eax\n"
+               "\tpushl %%ebx\n"
                "\txorl %%ebx, %%ebx\n"
                "\txorl %%ecx, %%ecx\n"
                "\txorl %%edx, %%edx\n"
@@ -68,7 +69,8 @@ static void cpuid_query(unsigned int index, jit_cpuid_x86_t *info)
                "\tmovl %%ebx, 4(%%esi)\n"
                "\tmovl %%ecx, 8(%%esi)\n"
                "\tmovl %%edx, 12(%%esi)\n"
-               : : "m"(index), "m"(info) : "eax", "ebx", "ecx", "edx", "esi"
+               "\tpopl %%ebx\n"
+               : : "m"(index), "m"(info) : "eax", "ecx", "edx", "esi"
        );
 #endif
 }