Fix: symbol aliases with TLS compat
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 12 Dec 2018 20:01:38 +0000 (15:01 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 Dec 2018 01:50:19 +0000 (20:50 -0500)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/urcu-bp.c
src/urcu-qsbr.c
src/urcu-utils.h
src/urcu.c

index 0653f9dff769b89281d5ec2edf4608d5604edbdf..54fda1650e4f813694886d3eca64e708b93eb76f 100644 (file)
@@ -151,8 +151,7 @@ URCU_ATTR_ALIAS("urcu_bp_gp") extern struct urcu_bp_gp rcu_gp_bp;
  * by both the reader and the writers.
  */
 DEFINE_URCU_TLS(struct urcu_bp_reader *, urcu_bp_reader);
-URCU_ATTR_ALIAS("urcu_bp_reader")
-extern struct urcu_bp_reader *rcu_reader_bp;
+DEFINE_URCU_TLS_ALIAS(struct urcu_bp_reader *, urcu_bp_reader, rcu_reader_bp);
 
 static CDS_LIST_HEAD(registry);
 
index 6ff933af4c6e1ef482c9b73b5acd133f23f41e84..ab20ebe2ce17f5af69cd785a506df86d67677eb1 100644 (file)
@@ -81,8 +81,7 @@ URCU_ATTR_ALIAS("urcu_qsbr_gp") extern struct urcu_gp rcu_gp_qsbr;
  * writers.
  */
 DEFINE_URCU_TLS(struct urcu_qsbr_reader, urcu_qsbr_reader);
-URCU_ATTR_ALIAS("urcu_qsbr_reader")
-extern struct urcu_qsbr_reader rcu_reader_qsbr;
+DEFINE_URCU_TLS_ALIAS(struct urcu_qsbr_reader, urcu_qsbr_reader, rcu_reader_qsbr);
 
 static CDS_LIST_HEAD(registry);
 
index 3c3c7a166198a20026f3f6e303215c6111415aac..eab6212dd61539651aaded7ad747874a6e9d1d92 100644 (file)
 #define URCU_ATTR_ALIAS(x) __attribute__((alias(x)))
 #endif
 
+#ifdef CONFIG_RCU_TLS
+#define DEFINE_URCU_TLS_ALIAS_1(type, name, alias)             \
+       URCU_ATTR_ALIAS(#name)                                  \
+       extern type alias
+
+#else
+#define DEFINE_URCU_TLS_ALIAS_1(type, name, alias)             \
+       URCU_ATTR_ALIAS("*__tls_access_" #name)                 \
+       type *__tls_access_ ## alias()
+#endif
+
+#define DEFINE_URCU_TLS_ALIAS(type, name, alias)               \
+       DEFINE_URCU_TLS_ALIAS_1(type, name, alias)
+
 #endif /* _URCU_UTILS_H */
index c4e2dde9ab798986111ff070741b18c9e2cd237f..2cac0b602d6694a945bef8692a9b38ed97c13152 100644 (file)
@@ -138,8 +138,7 @@ extern struct urcu_gp alias_rcu_gp;
  * writers.
  */
 DEFINE_URCU_TLS(struct urcu_reader, rcu_reader);
-URCU_ATTR_ALIAS(urcu_stringify(rcu_reader))
-extern struct urcu_reader alias_rcu_reader;
+DEFINE_URCU_TLS_ALIAS(struct urcu_reader, rcu_reader, alias_rcu_reader);
 
 static CDS_LIST_HEAD(registry);
 
This page took 0.027704 seconds and 4 git commands to generate.