From a306b1b908cacf49d17cf77437d38da98ca5edcf Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sun, 30 Dec 2018 02:14:33 +0000 Subject: [PATCH] Fix CFI annotations in p256-x86_64-asm.pl. This was caught by in-progress work to test unwind information. It was incorrect at two instructions: immediately before we jump to .Lpoint_double_shortcut$x. This is needed because ecp_nistz256_point_add$x tries to be clever about not unwinding the stack frame in its tail call. It's also unlikely that the SEH handlers in this file are correct at this point, but that will be handled separately while overhauling everything else here. (For Win64, probably the only ABI-compliant option is to just properly unwind the stack frame. Without a custom handler, Win64 unwind codes are very restrictive.) Bug: 181 Change-Id: I9f576d868850312d6c14d1386f8fbfa85021b347 Reviewed-on: https://boringssl-review.googlesource.com/c/33946 Commit-Queue: David Benjamin Reviewed-by: Adam Langley --- crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl b/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl index 1dc257d7..ab62a287 100755 --- a/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl +++ b/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl @@ -3114,7 +3114,9 @@ $code.=<<___; movq %xmm1, $a_ptr # restore $a_ptr movq %xmm0, $r_ptr # restore $r_ptr add \$`32*(18-5)`, %rsp # difference in frame sizes +.cfi_adjust_cfa_offset `-32*(18-5)` jmp .Lpoint_double_shortcut$x +.cfi_adjust_cfa_offset `32*(18-5)` .align 32 .Ladd_proceed$x: