Fix some compact unwind errors.
The Mac ld gets unhappy about "weird" unwind directives:
In chacha20_poly1305_x86_64.pl, $keyp is being pushed on the stack
(according to the comment) because it gets clobbered in the computation
somewhere. $keyp is %r9 which is not callee-saved (it's an argument
register), so we don't need to tag it with .cfi_offset.
In x25519-asm-x86_64.S, x25519_x86_64_mul saves %rdi on the stack.
However it too is not callee-saved (it's an argument register) and
should not have a .cfi_offset. %rdi also does not appear to be written
to anywhere in the function, so there's no need to save it at all.
(This does not resolve the "r15 is saved too far from return address"
errors. Just the non-standard register ones.)
BUG=176
Change-Id: I53f3f7db3d1745384fb47cb52cd6536aabb5065e
Reviewed-on: https://boringssl-review.googlesource.com/13560
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/cipher/asm/chacha20_poly1305_x86_64.pl b/crypto/cipher/asm/chacha20_poly1305_x86_64.pl
index 4a206b8..44590c2 100644
--- a/crypto/cipher/asm/chacha20_poly1305_x86_64.pl
+++ b/crypto/cipher/asm/chacha20_poly1305_x86_64.pl
@@ -453,7 +453,6 @@
.cfi_offset r13, -40
.cfi_offset r14, -48
.cfi_offset r15, -56
-.cfi_offset $keyp, -64
lea 32(%rsp), %rbp
and \$-32, %rbp
mov %rdx, 8+$len_store
@@ -852,7 +851,6 @@
.cfi_offset r13, -40
.cfi_offset r14, -48
.cfi_offset r15, -56
-.cfi_offset $keyp, -64
lea 32(%rsp), %rbp
and \$-32, %rbp
mov %rdx, 8+$len_store
diff --git a/crypto/curve25519/asm/x25519-asm-x86_64.S b/crypto/curve25519/asm/x25519-asm-x86_64.S
index 72f69db..dc8df94 100644
--- a/crypto/curve25519/asm/x25519-asm-x86_64.S
+++ b/crypto/curve25519/asm/x25519-asm-x86_64.S
@@ -143,8 +143,6 @@
.cfi_rel_offset rbx, -40
movq %rbp,-48(%rsp)
.cfi_rel_offset rbp, -48
-movq %rdi,-56(%rsp)
-.cfi_rel_offset rdi, -56
mov %rdx,%rcx
movq 24(%rsi),%rdx
imulq $19,%rdx,%rax