2115 md5 assembly doesn't compile with gas 2.22
Reviewed by: Keith Wesolowski <
[email protected]>
Reviewed by: Richard Lowe <
[email protected]>
Reviewed by: Robert Mustacchi <
[email protected]>
Approved by: Richard Lowe <
[email protected]>
--- a/usr/src/common/crypto/md5/amd64/md5_amd64.pl Tue Apr 17 09:30:53 2012 -0700
+++ b/usr/src/common/crypto/md5/amd64/md5_amd64.pl Mon Apr 16 21:31:22 2012 +0100
@@ -49,10 +49,12 @@
my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_;
$code .= " mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */\n" if ($pos == -1);
$code .= " mov %edx, %r11d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1);
+ $T_i = sprintf("-0x%08x", (0xffffffff ^ hex($T_i))+1)
+ if (hex($T_i) >= 0x80000000);
$code .= <<EOF;
xor $y, %r11d /* y ^ ... */
- lea $T_i($dst,%r10d),$dst /* Const + dst + ... */
+ lea $T_i($dst,%r10d),$dst /* Const + dst + ... r1 */
and $x, %r11d /* x & ... */
xor $z, %r11d /* z ^ ... */
mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */
@@ -75,10 +77,12 @@
$code .= " mov 1*4(%rsi), %r10d /* (NEXT STEP) X[1] */\n" if ($pos == -1);
$code .= " mov %edx, %r11d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1);
$code .= " mov %edx, %r12d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1);
+ $T_i = sprintf("-0x%08x", (0xffffffff ^ hex($T_i))+1)
+ if (hex($T_i) >= 0x80000000);
$code .= <<EOF;
not %r11d /* not z */
- lea $T_i($dst,%r10d),$dst /* Const + dst + ... */
+ lea $T_i($dst,%r10d),$dst /* Const + dst + ... r2 */
and $x, %r12d /* x & z */
and $y, %r11d /* y & (not z) */
mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */
@@ -101,9 +105,11 @@
my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_;
$code .= " mov 5*4(%rsi), %r10d /* (NEXT STEP) X[5] */\n" if ($pos == -1);
$code .= " mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */\n" if ($pos == -1);
+ $T_i = sprintf("-0x%08x", (0xffffffff ^ hex($T_i))+1)
+ if (hex($T_i) >= 0x80000000);
$code .= <<EOF;
- lea $T_i($dst,%r10d),$dst /* Const + dst + ... */
+ lea $T_i($dst,%r10d),$dst /* Const + dst + ... r3 */
mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */
xor $z, %r11d /* z ^ ... */
xor $x, %r11d /* x ^ ... */
@@ -126,9 +132,11 @@
$code .= " mov \$0xffffffff, %r11d\n" if ($pos == -1);
$code .= " xor %edx, %r11d /* (NEXT STEP) not z' = not %edx*/\n"
if ($pos == -1);
+ $T_i = sprintf("-0x%08x", (0xffffffff ^ hex($T_i))+1)
+ if (hex($T_i) >= 0x80000000);
$code .= <<EOF;
- lea $T_i($dst,%r10d),$dst /* Const + dst + ... */
+ lea $T_i($dst,%r10d),$dst /* Const + dst + ... r4 */
or $x, %r11d /* x | ... */
xor $y, %r11d /* y ^ ... */
add %r11d, $dst /* dst += ... */
--- a/usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl Tue Apr 17 09:30:53 2012 -0700
+++ b/usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl Mon Apr 16 21:31:22 2012 +0100
@@ -162,7 +162,7 @@
sub BODY_20_39 {
my ($i,$a,$b,$c,$d,$e,$f)=@_;
my $j=$i+1;
-my $K=($i<40)?0x6ed9eba1:0xca62c1d6;
+my $K=($i<40)?"0x6ed9eba1":"-0x359d3e2a";
$code.=<<___ if ($i<79);
lea $K($xi,$e),$f
mov `4*($j%16)`(%rsp),$xi
@@ -199,7 +199,7 @@
my ($i,$a,$b,$c,$d,$e,$f)=@_;
my $j=$i+1;
$code.=<<___;
- lea 0x8f1bbcdc($xi,$e),$f
+ lea -0x70e44324($xi,$e),$f
mov `4*($j%16)`(%rsp),$xi
mov $b,$t0
mov $b,$t1
--- a/usr/src/psm/stand/bootblks/ufs/i386/mboot.S Tue Apr 17 09:30:53 2012 -0700
+++ b/usr/src/psm/stand/bootblks/ufs/i386/mboot.S Mon Apr 16 21:31:22 2012 +0100
@@ -20,10 +20,10 @@
* CDDL HEADER END
*/
/*
+ * Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
+ *
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
/*
@@ -103,7 +103,7 @@
* between two labels. The ending label must be the same as the starting label
* but with a suffix "_end".
*/
-#define SIZEOF(label) (offset label##_end - offset label)
+#define SIZEOF(label) (label##_end - label)
.title "Solaris_Master_Boot"