From f88ff7028794a7a7ac8671b298e0937e49c90829 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 5 Sep 2016 18:20:26 -0400 Subject: [PATCH] Fix: Restartable Sequences: testing: ip-relative x86-64 Allow rseq to be used in PIC code (library code) on x86-64. Signed-off-by: Mathieu Desnoyers --- tools/testing/selftests/rseq/rseq-x86.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/rseq/rseq-x86.h b/tools/testing/selftests/rseq/rseq-x86.h index cca5ba2f9ad6..9dab0946a35a 100644 --- a/tools/testing/selftests/rseq/rseq-x86.h +++ b/tools/testing/selftests/rseq/rseq-x86.h @@ -65,7 +65,8 @@ do { \ "1:\n\t" \ _setup \ RSEQ_INJECT_ASM(1) \ - "movq $3b, %[rseq_cs]\n\t" \ + "leaq 3b(%%rip), %%rax\n\t" \ + "movq %%rax, %[rseq_cs]\n\t" \ RSEQ_INJECT_ASM(2) \ "cmpl %[start_event_counter], %[current_event_counter]\n\t" \ "jnz 4f\n\t" \ @@ -89,7 +90,7 @@ do { \ _spec_input \ _final_input \ RSEQ_INJECT_INPUT \ - : "memory", "cc" \ + : "memory", "cc", "rax" \ _extra_clobber \ RSEQ_INJECT_CLOBBER \ : _failure \ -- 2.34.1