summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2012-04-13 17:16:59 +0000
committerRobert Mustacchi <rm@joyent.com>2012-04-13 20:27:07 +0000
commit34f56eddd8eb45eeec79687683281546a35fc7d6 (patch)
treed47988e98bcf545c1e83b444f37ed08195fc45d8 /usr/src
parent6a257671a53019c0387e873ba3771dc522f75caa (diff)
downloadillumos-joyent-34f56eddd8eb45eeec79687683281546a35fc7d6.tar.gz
OS-1099 Want support for binutils 2.22
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/common/crypto/md5/amd64/md5_amd64.pl16
-rw-r--r--usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl4
-rw-r--r--usr/src/psm/stand/bootblks/ufs/i386/mboot.S5
3 files changed, 16 insertions, 9 deletions
diff --git a/usr/src/common/crypto/md5/amd64/md5_amd64.pl b/usr/src/common/crypto/md5/amd64/md5_amd64.pl
index 2570efd320..3290a656b3 100644
--- a/usr/src/common/crypto/md5/amd64/md5_amd64.pl
+++ b/usr/src/common/crypto/md5/amd64/md5_amd64.pl
@@ -49,10 +49,12 @@ sub round1_step
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 @@ sub round2_step
$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 @@ sub round3_step
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 @@ sub round4_step
$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 += ... */
diff --git a/usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl b/usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl
index 94867978b1..4ca9a14f45 100644
--- a/usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl
+++ b/usr/src/common/crypto/sha1/amd64/sha1-x86_64.pl
@@ -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 @@ sub BODY_40_59 {
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
diff --git a/usr/src/psm/stand/bootblks/ufs/i386/mboot.S b/usr/src/psm/stand/bootblks/ufs/i386/mboot.S
index 646f1ef554..c139eb2586 100644
--- a/usr/src/psm/stand/bootblks/ufs/i386/mboot.S
+++ b/usr/src/psm/stand/bootblks/ufs/i386/mboot.S
@@ -21,9 +21,8 @@
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2012 OmniTI Computer Consulting, Inc. All rights reserved.
* Use is subject to license terms.
- *
- * ident "%Z%%M% %I% %E% SMI"
*/
/*
@@ -103,7 +102,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"