Does it actually pass the tests by the way? Point is that push %ebx is not accounted to stack pointer and if "m"(iv) is on stack (and it is), then attempt to reference it from assembler template results on off-by-4 effective address... Provided that we compile with -fomit-frame-pointer (as we do)... What you should do is following:

asm volatile (  "pushl     %%ebx\n"
                "leal      16(%%eax),%%edx\n"
                "leal      32(%%eax),%%ebx\n"
                opcode
                "popl      %%ebx\n"
                : "+a"(cdata),"+S"(input),"+D"(output)
                : "c" (count) : "edx");

We can use leal instructions, because we've collected all the bits in one aligned structure. I assume that eax doesn't have to be saved. If it has to, then I can think of a way...

For those who wonder. Why we can't use "b"(something) in templates or mark "ebx" as clobbered? We can't use "b"(something) because compiler won't let us to and we try to compile position independent code. We can't mask "ebx" as clobbered, because compiler does not respect it, again when we try to compile position independent code (must be a bug, but it's there is several compiler versions). Which by the way brings us to the following:

asm volatile ("cpuid; movl %%ebx, (%%edi); movl %%edx, 4(%%edi); movl %%ecx, 8(%%edi)"
: "+a"(eax) : "mD"(vendor_string) : "ebx", "ecx", "edx");


It should also be surrounded by push %ebx and pop %ebx, because as above ebx comes out corrupted in PIC [at lest with compilers I've tested].

If it's OK with you I can fix the code to my "liking" and send it back... A.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to