From 97c94fbe87e95de88cb5c906313dd4ec1beb4c62 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sun, 3 Mar 2024 12:08:15 -0500 Subject: [PATCH] x86-32: ip-relative: return to post-call address This simplifies the assembler returns to the expected (speculated) address. Signed-off-by: Mathieu Desnoyers Change-Id: I68c59f72ac32011d37cc9399414ff328f7b8fdd0 --- include/rseq/arch/x86.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/rseq/arch/x86.h b/include/rseq/arch/x86.h index 5553f47..a6a4068 100644 --- a/include/rseq/arch/x86.h +++ b/include/rseq/arch/x86.h @@ -170,12 +170,12 @@ do { \ * ref_label. */ # define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs, ref_ip, ref_label) \ - "call 880f\n\t" \ + "jmp 779f\n\t" \ "880:\n\t" \ - "popl %%eax\n\t" \ - "leal (" __rseq_str(ref_label) "f-880b)(%%eax), %%eax\n\t" \ - "pushl %%eax\n\t" \ + "movl (%%esp), %%eax\n\t" \ "ret\n\t" \ + "779:\n\t" \ + "call 880b\n\t" \ __rseq_str(ref_label) ":\n\t" \ "movl %%eax, " __rseq_str(ref_ip) "\n\t" \ "leal (" __rseq_str(cs_label) " - " __rseq_str(ref_label) "b)(%%eax), %%eax\n\t" \ -- 2.34.1