Introduce __rseq_cs_ptr_array, rename __rseq_table to __rseq_cs
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Mar 2019 17:20:42 +0000 (13:20 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 13 Mar 2019 19:47:25 +0000 (15:47 -0400)
The entries within __rseq_table are aligned on 32 bytes due to
linux/rseq.h struct rseq_cs uapi requirements, but the start of the
__rseq_table section is not guaranteed to be 32-byte aligned. It can
cause padding to be added at the start of the section, which makes it
hard to use as an array of items by debuggers.

Considering that __rseq_table does not really consist of a table due to
the presence of padding, rename this section to __rseq_cs.

Create a new __rseq_cs_ptr_array section which contains 64-bit packed
pointers to entries within the __rseq_cs section.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/rseq/rseq-arm.h
include/rseq/rseq-arm64.h
include/rseq/rseq-mips.h
include/rseq/rseq-ppc.h
include/rseq/rseq-s390.h
include/rseq/rseq-x86.h

index 8b931c7a55efb16643c221e14852bc29a0297bba..d2c7905e394a15132f2ea3f3942bb0da94d9e955 100644 (file)
@@ -30,24 +30,28 @@ do {                                                                        \
 #include "rseq-skip.h"
 #else /* !RSEQ_SKIP_FASTPATH */
 
-#define __RSEQ_ASM_DEFINE_TABLE(version, flags,        start_ip,               \
+#define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip,       \
                                post_commit_offset, abort_ip)           \
-               ".pushsection __rseq_table, \"aw\"\n\t"                 \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                    \
                ".balign 32\n\t"                                        \
+               __rseq_str(label) ":\n\t"                                       \
                ".word " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
                ".word " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) ", 0x0\n\t" \
+               ".popsection\n\t"                                       \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"          \
+               ".word " __rseq_str(label) "b, 0x0\n\t"                 \
                ".popsection\n\t"
 
-#define RSEQ_ASM_DEFINE_TABLE(start_ip, post_commit_ip, abort_ip)      \
-       __RSEQ_ASM_DEFINE_TABLE(0x0, 0x0, start_ip,                     \
+#define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \
+       __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip,              \
                                (post_commit_ip - start_ip), abort_ip)
 
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                  \
                ".pushsection __rseq_exit_point_array, \"aw\"\n\t"      \
@@ -98,7 +102,7 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -165,7 +169,7 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -236,7 +240,7 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
 #endif
@@ -291,7 +295,7 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -366,7 +370,7 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -442,7 +446,7 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -526,7 +530,7 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -650,7 +654,7 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
index 370093d8926f9ce69b8d9ef62820d18e9d41d059..ff10a055ec1847acb7f77dc99afb6152a3a682ad 100644 (file)
@@ -82,13 +82,16 @@ do {                                                                                \
 
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip,               \
                                post_commit_offset, abort_ip)                   \
-       "       .pushsection    __rseq_table, \"aw\"\n"                         \
+       "       .pushsection    __rseq_cs, \"aw\"\n"                            \
        "       .balign 32\n"                                                   \
        __rseq_str(label) ":\n"                                                 \
        "       .long   " __rseq_str(version) ", " __rseq_str(flags) "\n"       \
        "       .quad   " __rseq_str(start_ip) ", "                             \
                          __rseq_str(post_commit_offset) ", "                   \
                          __rseq_str(abort_ip) "\n"                             \
+       "       .popsection\n\t"                                                \
+       "       .pushsection __rseq_cs_ptr_array, \"aw\"\n"                             \
+       "       .quad " __rseq_str(label) "b\n"                                 \
        "       .popsection\n"
 
 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip)       \
@@ -98,9 +101,9 @@ do {                                                                         \
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                          \
        "       .pushsection __rseq_exit_point_array, \"aw\"\n"                 \
index 08b7dccc08057f5adaa3ea6a3c1a133ab44f91d8..0cbef5a78ce7ce25aae09a38e3dcf6f282db1648 100644 (file)
@@ -54,26 +54,30 @@ do {                                                                        \
 # error unsupported _MIPS_SZLONG
 #endif
 
-#define __RSEQ_ASM_DEFINE_TABLE(version, flags,        start_ip, \
+#define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip, \
                                post_commit_offset, abort_ip) \
-               ".pushsection __rseq_table, \"aw\"\n\t" \
+               ".pushsection __rseq_cs, \"aw\"\n\t" \
                ".balign 32\n\t" \
+               __rseq_str(label) ":\n\t"                                       \
                ".word " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
                LONG " " U32_U64_PAD(__rseq_str(start_ip)) "\n\t" \
                LONG " " U32_U64_PAD(__rseq_str(post_commit_offset)) "\n\t" \
                LONG " " U32_U64_PAD(__rseq_str(abort_ip)) "\n\t" \
+               ".popsection\n\t" \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t" \
+               LONG " " U32_U64_PAD(__rseq_str(label) "b") "\n\t" \
                ".popsection\n\t"
 
-#define RSEQ_ASM_DEFINE_TABLE(start_ip, post_commit_ip, abort_ip) \
-       __RSEQ_ASM_DEFINE_TABLE(0x0, 0x0, start_ip, \
+#define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \
+       __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip, \
                                (post_commit_ip - start_ip), abort_ip)
 
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip) \
                ".pushsection __rseq_exit_point_array, \"aw\"\n\t" \
@@ -126,7 +130,7 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -191,7 +195,7 @@ int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -260,7 +264,7 @@ int rseq_addv(intptr_t *v, intptr_t count, int cpu)
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
 #endif
@@ -315,7 +319,7 @@ int rseq_cmpeqv_trystorev_storev(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -388,7 +392,7 @@ int rseq_cmpeqv_trystorev_storev_release(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -462,7 +466,7 @@ int rseq_cmpeqv_cmpeqv_storev(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -542,7 +546,7 @@ int rseq_cmpeqv_trymemcpy_storev(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
@@ -663,7 +667,7 @@ int rseq_cmpeqv_trymemcpy_storev_release(intptr_t *v, intptr_t expect,
 
        rseq_workaround_gcc_asm_size_guess();
        __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(1f, 2f, 4f) /* start, commit, abort */
+               RSEQ_ASM_DEFINE_TABLE(9, 1f, 2f, 4f) /* start, commit, abort */
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[cmpfail])
 #ifdef RSEQ_COMPARE_TWICE
                RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
index 1e579da8b0d3be79850b46eeaef0407f1b634f47..e8d631074682c1cf71b9deae0c16d6866aafd7b0 100644 (file)
@@ -33,8 +33,8 @@ do {                                                                  \
 #else /* !RSEQ_SKIP_FASTPATH */
 
 /*
- * The __rseq_table section can be used by debuggers to better handle
- * single-stepping through the restartable critical sections.
+ * The __rseq_cs_ptr_array and __rseq_cs sections can be used by debuggers to
+ * better handle single-stepping through the restartable critical sections.
  */
 
 #ifdef __PPC64__
@@ -46,11 +46,14 @@ do {                                                                        \
 
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                         \
                        start_ip, post_commit_offset, abort_ip)                 \
-               ".pushsection __rseq_table, \"aw\"\n\t"                         \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                            \
                ".balign 32\n\t"                                                \
                __rseq_str(label) ":\n\t"                                       \
                ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t"      \
                ".quad " __rseq_str(start_ip) ", " __rseq_str(post_commit_offset) ", " __rseq_str(abort_ip) "\n\t" \
+               ".popsection\n\t"                                               \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"                  \
+               ".quad " __rseq_str(label) "b\n\t"                              \
                ".popsection\n\t"
 
 #define RSEQ_ASM_STORE_RSEQ_CS(label, cs_label, rseq_cs)                       \
@@ -66,9 +69,9 @@ do {                                                                  \
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                  \
                ".pushsection __rseq_exit_point_array, \"aw\"\n\t"      \
@@ -84,18 +87,21 @@ do {                                                                        \
 
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                         \
                        start_ip, post_commit_offset, abort_ip)                 \
-               ".pushsection __rseq_table, \"aw\"\n\t"                         \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                            \
                ".balign 32\n\t"                                                \
                __rseq_str(label) ":\n\t"                                       \
                ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t"      \
                /* 32-bit only supported on BE */                               \
                ".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) "\n\t" \
+               ".popsection\n\t"                                       \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"          \
+               ".long 0x0, " __rseq_str(label) "b\n\t"                 \
                ".popsection\n\t"
 
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
+ * is already part of the __rseq_cs and should not be explicitly defined as
  * an additional exit point. Knowing all exit points is useful to assist
  * debuggers stepping over the critical section.
  */
index 03e5589a7ca92e8faa1a047f37c955fb0d23af99..c5be3ef808b503482c1ab5dd3397f1d6a2fb11e5 100644 (file)
@@ -37,19 +37,22 @@ do {                                                                        \
 
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                 \
                                start_ip, post_commit_offset, abort_ip) \
-               ".pushsection __rseq_table, \"aw\"\n\t"                 \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                    \
                ".balign 32\n\t"                                        \
                __rseq_str(label) ":\n\t"                               \
                ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
                ".quad " __rseq_str(start_ip) ", " __rseq_str(post_commit_offset) ", " __rseq_str(abort_ip) "\n\t" \
+               ".popsection\n\t"                                       \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"          \
+               ".quad " __rseq_str(label) "b\n\t"                      \
                ".popsection\n\t"
 
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                  \
                ".pushsection __rseq_exit_point_array, \"aw\"\n\t"      \
@@ -60,17 +63,20 @@ do {                                                                        \
 
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                 \
                                start_ip, post_commit_offset, abort_ip) \
-               ".pushsection __rseq_table, \"aw\"\n\t"                 \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                    \
                ".balign 32\n\t"                                        \
                __rseq_str(label) ":\n\t"                               \
                ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
                ".long 0x0, " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) "\n\t" \
+               ".popsection\n\t"                                       \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"          \
+               ".long 0x0, " __rseq_str(label) "b\n\t"                 \
                ".popsection\n\t"
 
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
+ * is already part of the __rseq_cs and should not be explicitly defined as
  * an additional exit point. Knowing all exit points is useful to assist
  * debuggers stepping over the critical section.
  */
index 0f67b0ffab07059507fbb0a14b64afcaa35f093d..14ba97000b373529eefd2d5a828f32adfdecb00c 100644 (file)
@@ -37,13 +37,17 @@ do {                                                                        \
 
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                 \
                                start_ip, post_commit_offset, abort_ip) \
-               ".pushsection __rseq_table, \"aw\"\n\t"                 \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                    \
                ".balign 32\n\t"                                        \
                __rseq_str(label) ":\n\t"                               \
                ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
                ".quad " __rseq_str(start_ip) ", " __rseq_str(post_commit_offset) ", " __rseq_str(abort_ip) "\n\t" \
+               ".popsection\n\t"                                       \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"          \
+               ".quad " __rseq_str(label) "b\n\t"                      \
                ".popsection\n\t"
 
+
 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \
        __RSEQ_ASM_DEFINE_TABLE(label, 0x0, 0x0, start_ip,              \
                                (post_commit_ip - start_ip), abort_ip)
@@ -51,9 +55,9 @@ do {                                                                  \
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                  \
                ".pushsection __rseq_exit_point_array, \"aw\"\n\t"      \
@@ -561,11 +565,14 @@ do {                                                                      \
  */
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                 \
                                start_ip, post_commit_offset, abort_ip) \
-               ".pushsection __rseq_table, \"aw\"\n\t"                 \
+               ".pushsection __rseq_cs, \"aw\"\n\t"                    \
                ".balign 32\n\t"                                        \
                __rseq_str(label) ":\n\t"                               \
                ".long " __rseq_str(version) ", " __rseq_str(flags) "\n\t" \
                ".long " __rseq_str(start_ip) ", 0x0, " __rseq_str(post_commit_offset) ", 0x0, " __rseq_str(abort_ip) ", 0x0\n\t" \
+               ".popsection\n\t"                                       \
+               ".pushsection __rseq_cs_ptr_array, \"aw\"\n\t"          \
+               ".long " __rseq_str(label) "b, 0x0\n\t"                 \
                ".popsection\n\t"
 
 #define RSEQ_ASM_DEFINE_TABLE(label, start_ip, post_commit_ip, abort_ip) \
@@ -575,9 +582,9 @@ do {                                                                        \
 /*
  * Exit points of a rseq critical section consist of all instructions outside
  * of the critical section where a critical section can branch to. The abort IP
- * is already part of the __rseq_table and should not be explicitly defined as
- * an additional exit point. Knowing all exit points is useful to assist
- * debuggers stepping over the critical section.
+ * is already part of the __rseq_cs section and should not be explicitly
+ * defined as an additional exit point. Knowing all exit points is useful to
+ * assist debuggers stepping over the critical section.
  */
 #define RSEQ_ASM_DEFINE_EXIT_POINT(start_ip, exit_ip)                  \
                ".pushsection __rseq_exit_point_array, \"aw\"\n\t"      \
This page took 0.036168 seconds and 4 git commands to generate.