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 0653f9d..54fda16 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);
  * 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);
 
 
 static CDS_LIST_HEAD(registry);
 
index 6ff933a..ab20ebe 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);
  * 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);
 
 
 static CDS_LIST_HEAD(registry);
 
index 3c3c7a1..eab6212 100644 (file)
 #define URCU_ATTR_ALIAS(x) __attribute__((alias(x)))
 #endif
 
 #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 */
 #endif /* _URCU_UTILS_H */
index c4e2dde..2cac0b6 100644 (file)
@@ -138,8 +138,7 @@ extern struct urcu_gp alias_rcu_gp;
  * writers.
  */
 DEFINE_URCU_TLS(struct urcu_reader, rcu_reader);
  * 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);
 
 
 static CDS_LIST_HEAD(registry);
 
This page took 0.033568 seconds and 4 git commands to generate.