aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-03 23:12:20 +0000
committerlloyd <[email protected]>2009-11-03 23:12:20 +0000
commitcb0d4a18f2fc77a40f6055fedb43b78606068b7b (patch)
treeb64af2ec36a07fcfb763080b9e699f988307f209 /src
parent9032fa6c541eb51c47dc7971b5d82171a1274db7 (diff)
Use negative values for adding constants >= 2^31 in the SHA-1 x86-64 asm.
Seems binutils 2.20.51.0.2 breaks otherwise, and binutils maintainers claim it's not a bug. Meh.
Diffstat (limited to 'src')
-rw-r--r--src/hash/sha1_amd64/sha1_amd64_imp.S10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/hash/sha1_amd64/sha1_amd64_imp.S b/src/hash/sha1_amd64/sha1_amd64_imp.S
index 34a8318ed..ba4d4d5ef 100644
--- a/src/hash/sha1_amd64/sha1_amd64_imp.S
+++ b/src/hash/sha1_amd64/sha1_amd64_imp.S
@@ -103,10 +103,16 @@ ALIGN;
subq $320, W
+/*
+* Using negative values for SHA-1 constants > 2^31 to work around
+* a bug in binutils not accepting large lea displacements.
+* -0x70E44324 == 0x8F1BBCDC
+* -0x359D3E2A == 0xCA62C1D6
+*/
#define MAGIC1 0x5A827999
#define MAGIC2 0x6ED9EBA1
-#define MAGIC3 0x8F1BBCDC
-#define MAGIC4 0xCA62C1D6
+#define MAGIC3 -0x70E44324
+#define MAGIC4 -0x359D3E2A
#define T %esi
#define T2 %eax