public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2024-02-07 14:11 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:11 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4ed709b90d0c171aa6d31f920010cf0ec783b537
commit 4ed709b90d0c171aa6d31f920010cf0ec783b537
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 7b3dd9ab60..020ec60957 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index e498fab8fe..70c26a68b3 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index a1d8c0915d..f13b4d5c2f 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index 29924b866d..d87a05b95e 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 049161f02f..c138c5ce70 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2024-04-17 20:11 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:11 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d5eaf6b1068e06df0d6f7ece3c32f7c0b8cedf78
commit d5eaf6b1068e06df0d6f7ece3c32f7c0b8cedf78
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 7b3dd9ab60..020ec60957 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index e498fab8fe..70c26a68b3 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index a1d8c0915d..f13b4d5c2f 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index 29924b866d..d87a05b95e 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 049161f02f..c138c5ce70 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2024-04-02 15:57 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:57 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=dd997dc997bd84cf61c5362bd437e77c142cd625
commit dd997dc997bd84cf61c5362bd437e77c142cd625
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 7b3dd9ab60..020ec60957 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index e498fab8fe..70c26a68b3 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index a1d8c0915d..f13b4d5c2f 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index 29924b866d..d87a05b95e 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 049161f02f..c138c5ce70 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2024-02-09 17:35 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:35 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0d9d1f3feb3afe4e577c00091ede83a7ccadaa72
commit 0d9d1f3feb3afe4e577c00091ede83a7ccadaa72
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 7b3dd9ab60..020ec60957 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index e498fab8fe..70c26a68b3 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index a1d8c0915d..f13b4d5c2f 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index 29924b866d..d87a05b95e 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 049161f02f..c138c5ce70 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2024-01-29 18:01 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 18:01 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1e67098c520b2a7c3329e20646e415649363effd
commit 1e67098c520b2a7c3329e20646e415649363effd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 7b3dd9ab60..020ec60957 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index e498fab8fe..70c26a68b3 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index a1d8c0915d..f13b4d5c2f 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index 29924b866d..d87a05b95e 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 049161f02f..c138c5ce70 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2023-12-21 18:57 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:57 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=06b6f6f4d95fd0b1168766053a642867bc2804de
commit 06b6f6f4d95fd0b1168766053a642867bc2804de
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 70446e71a8..b58a93abb0 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index bd83c82f63..6aa5628184 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index ffa9b038b2..8bd2b779e0 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index a551594b64..4ea9369928 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 67c8ae639c..3f51da565d 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2023-09-28 17:56 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:56 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7821059736a5c3ab58be92c16cffed1bc2f6863a
commit 7821059736a5c3ab58be92c16cffed1bc2f6863a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index c192b5a13a..ccf2366cfb 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index bd83c82f63..6aa5628184 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index ffa9b038b2..8bd2b779e0 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index a551594b64..4ea9369928 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 67c8ae639c..3f51da565d 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2023-08-30 12:40 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:40 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e916c73c425230c0cd981b50b886ceefc2191de5
commit e916c73c425230c0cd981b50b886ceefc2191de5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 99b83ca696..45e4569f3f 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index bd83c82f63..6aa5628184 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index ffa9b038b2..8bd2b779e0 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index a551594b64..4ea9369928 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 67c8ae639c..3f51da565d 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2023-02-09 19:52 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:52 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=575329cf73a99291a5d2b187391f9da07312e584
commit 575329cf73a99291a5d2b187391f9da07312e584
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 8943a3b4ae..fc4dda8e50 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index bd83c82f63..6aa5628184 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index ffa9b038b2..8bd2b779e0 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index a551594b64..4ea9369928 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index 67c8ae639c..3f51da565d 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2022-10-28 17:45 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:45 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f2cf6c126b8195aa790bf3687e33eab0f57b3156
commit f2cf6c126b8195aa790bf3687e33eab0f57b3156
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 093cdddb7e..5c80122c3e 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index 56ed58fdbb..a6d652dfde 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index 3fa85badb3..82aa3cafd4 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index f82edcae76..e463e030ee 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index e5768347ca..f430b20b3b 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
* [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void
@ 2022-10-04 13:03 Adhemerval Zanella
0 siblings, 0 replies; 11+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 13:03 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8d62a70716961de1f1032849e6cd92ef1a9d1c63
commit 8d62a70716961de1f1032849e6cd92ef1a9d1c63
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Mar 25 15:46:10 2022 -0300
elf: Do not cast TLS_DTV_UNALLOCATED to void
The test-as-const-tlsdesc uses _Static_assert to verify the constants
generated and clang warns the expression is not an integral constant
expression because the cast performs a conversion (and it is no
allowed).
Diff:
---
elf/dl-tls.c | 2 ++
sysdeps/aarch64/tlsdesc.sym | 2 +-
sysdeps/arc/dl-tls.h | 2 +-
sysdeps/generic/dl-dtv.h | 2 +-
sysdeps/loongarch/dl-tls.h | 3 ---
sysdeps/riscv/dl-tls.h | 2 +-
6 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/elf/dl-tls.c b/elf/dl-tls.c
index 093cdddb7e..5c80122c3e 100644
--- a/elf/dl-tls.c
+++ b/elf/dl-tls.c
@@ -75,6 +75,8 @@
/* Default for dl_tls_static_optional. */
#define OPTIONAL_TLS 512
+#define TLS_DTV_UNALLOCATED ((void *) TLS_DTV_UNALLOCATED_VALUE)
+
/* Compute the static TLS surplus based on the namespace count and the
TLS space that can be used for optimizations. */
static inline int
diff --git a/sysdeps/aarch64/tlsdesc.sym b/sysdeps/aarch64/tlsdesc.sym
index a06a719779..477585bdcb 100644
--- a/sysdeps/aarch64/tlsdesc.sym
+++ b/sysdeps/aarch64/tlsdesc.sym
@@ -15,4 +15,4 @@ TLSDESC_MODID offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_module)
TLSDESC_MODOFF offsetof(struct tlsdesc_dynamic_arg, tlsinfo.ti_offset)
TCBHEAD_DTV offsetof(tcbhead_t, dtv)
DTV_COUNTER offsetof(dtv_t, counter)
-TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED
+TLS_DTV_UNALLOCATED TLS_DTV_UNALLOCATED_VALUE
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
index 56ed58fdbb..a6d652dfde 100644
--- a/sysdeps/arc/dl-tls.h
+++ b/sysdeps/arc/dl-tls.h
@@ -27,4 +27,4 @@ typedef struct
extern void *__tls_get_addr (tls_index *ti);
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALE -1l
diff --git a/sysdeps/generic/dl-dtv.h b/sysdeps/generic/dl-dtv.h
index 3fa85badb3..82aa3cafd4 100644
--- a/sysdeps/generic/dl-dtv.h
+++ b/sysdeps/generic/dl-dtv.h
@@ -33,6 +33,6 @@ typedef union dtv
} dtv_t;
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
#endif /* _DLT_DTV_H */
diff --git a/sysdeps/loongarch/dl-tls.h b/sysdeps/loongarch/dl-tls.h
index f82edcae76..e463e030ee 100644
--- a/sysdeps/loongarch/dl-tls.h
+++ b/sysdeps/loongarch/dl-tls.h
@@ -41,6 +41,3 @@ extern void *__tls_get_addr (tls_index *ti);
#define GET_ADDR_OFFSET (ti->ti_offset + TLS_DTV_OFFSET)
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
-
-/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
diff --git a/sysdeps/riscv/dl-tls.h b/sysdeps/riscv/dl-tls.h
index e5768347ca..f430b20b3b 100644
--- a/sysdeps/riscv/dl-tls.h
+++ b/sysdeps/riscv/dl-tls.h
@@ -45,4 +45,4 @@ extern void *__tls_get_addr (tls_index *ti);
#define __TLS_GET_ADDR(__ti) (__tls_get_addr (__ti) - TLS_DTV_OFFSET)
/* Value used for dtv entries for which the allocation is delayed. */
-#define TLS_DTV_UNALLOCATED ((void *) -1l)
+#define TLS_DTV_UNALLOCATED_VALUE -1l
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-04-17 20:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-07 14:11 [glibc/azanella/clang] elf: Do not cast TLS_DTV_UNALLOCATED to void Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:11 Adhemerval Zanella
2024-04-02 15:57 Adhemerval Zanella
2024-02-09 17:35 Adhemerval Zanella
2024-01-29 18:01 Adhemerval Zanella
2023-12-21 18:57 Adhemerval Zanella
2023-09-28 17:56 Adhemerval Zanella
2023-08-30 12:40 Adhemerval Zanella
2023-02-09 19:52 Adhemerval Zanella
2022-10-28 17:45 Adhemerval Zanella
2022-10-04 13:03 Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).