"movq %%r15,%c[r15_off](%[regs])\n\t" \
"movw %%cs,%c[cs_off](%[regs])\n\t" \
"movw %%ss,%c[ss_off](%[regs])\n\t" \
"movq %%r15,%c[r15_off](%[regs])\n\t" \
"movw %%cs,%c[cs_off](%[regs])\n\t" \
"movw %%ss,%c[ss_off](%[regs])\n\t" \
: [regs] "r" (regsptr), \
[rax_off] "i" (offsetof(struct registers, rax)), \
[rbx_off] "i" (offsetof(struct registers, rbx)), \
: [regs] "r" (regsptr), \
[rax_off] "i" (offsetof(struct registers, rax)), \
[rbx_off] "i" (offsetof(struct registers, rbx)), \
[r14_off] "i" (offsetof(struct registers, r14)), \
[r15_off] "i" (offsetof(struct registers, r15)), \
[cs_off] "i" (offsetof(struct registers, cs)), \
[r14_off] "i" (offsetof(struct registers, r14)), \
[r15_off] "i" (offsetof(struct registers, r15)), \
[cs_off] "i" (offsetof(struct registers, cs)), \
- [ss_off] "i" (offsetof(struct registers, ss)), \
- [rip_off] "i" (offsetof(struct registers, rip)) \
+ [ss_off] "i" (offsetof(struct registers, ss)) \
+/* Macro to insert the address of a relative jump in an assembly stub,
+ * in a relocatable way. On x86-64, this uses a special (%rip) notation. */
+#define RELATIVE_ADDRESS(__rel_label__) __rel_label__(%%rip)
+
+#define _ASM_PTR ".quad "
+