Fix CFI directives in memmove implementation
This CL adds CFI directives to emit correct DWARF information for
memmove and memcpy.
Bug: 390103836
Test: boot cuttlefish
Test: check dwarf with objdump
Change-Id: Id1485712863ae0474727a8f38fa24027513ed5a2
diff --git a/libc/arch-x86_64/string/sse2-memmove-slm.S b/libc/arch-x86_64/string/sse2-memmove-slm.S
index 8b32680..b787385 100644
--- a/libc/arch-x86_64/string/sse2-memmove-slm.S
+++ b/libc/arch-x86_64/string/sse2-memmove-slm.S
@@ -79,18 +79,23 @@
#endif
#define CFI_PUSH(REG) \
- cfi_adjust_cfa_offset (4); \
+ cfi_adjust_cfa_offset (8); \
cfi_rel_offset (REG, 0)
#define CFI_POP(REG) \
- cfi_adjust_cfa_offset (-4); \
+ cfi_adjust_cfa_offset (-8); \
cfi_restore (REG)
#define PUSH(REG) push REG;
#define POP(REG) pop REG;
-#define ENTRANCE PUSH (%rbx);
-#define RETURN_END POP (%rbx); ret
+#define ENTRANCE \
+ PUSH (%rbx); \
+ CFI_PUSH (%rbx);
+#define RETURN_END \
+ POP (%rbx); \
+ CFI_POP (%rbx); \
+ ret
#define RETURN RETURN_END;
.section .text.sse2,"ax",@progbits