about summary refs log tree commit diff
path: root/nptl_db/db_info.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-11-12 12:41:34 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-11-12 13:54:30 +0100
commitcba932a5a9e91cffd7f4172d7e91f9b2efb1f84b (patch)
tree82fb283a15d1ff654e6b54d86008917386a03da3 /nptl_db/db_info.c
parent42b926d303e571d5f9a4e97ffdb8e05d1eabae66 (diff)
downloadglibc-cba932a5a9e91cffd7f4172d7e91f9b2efb1f84b.tar.gz
glibc-cba932a5a9e91cffd7f4172d7e91f9b2efb1f84b.tar.xz
glibc-cba932a5a9e91cffd7f4172d7e91f9b2efb1f84b.zip
slotinfo in struct dtv_slotinfo_list should be flexible array [BZ #25097]
GCC 10 will warn about subscribing inner length zero arrays.  Use a GCC
extension in csu/libc-tls.c to allocate space for the static_slotinfo
variable.  Adjust nptl_db so that the type description machinery does
not attempt to determine the size of the flexible array member slotinfo.

Change-Id: I51be146a7857186a4ede0bb40b332509487bdde8
Diffstat (limited to 'nptl_db/db_info.c')
-rw-r--r--nptl_db/db_info.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/nptl_db/db_info.c b/nptl_db/db_info.c
index af7f754b32..40efe1a29b 100644
--- a/nptl_db/db_info.c
+++ b/nptl_db/db_info.c
@@ -56,6 +56,9 @@ extern bool __nptl_initial_report_events;
   DB_DEFINE_DESC (name, \
 		  8 * sizeof (obj)[0], sizeof (obj) / sizeof (obj)[0], \
 		  offset);
+/* Flexible arrays do not have a length that can be determined.  */
+#define FLEXIBLE_ARRAY_DESC(name, offset, obj) \
+  DB_DEFINE_DESC (name, 8 * sizeof (obj)[0], 0, offset);
 
 #if TLS_TCB_AT_TP
 # define dtvp header.dtv
@@ -77,6 +80,9 @@ DESC (_thread_db_pthread_dtvp,
 #define DB_STRUCT_ARRAY_FIELD(type, field) \
   ARRAY_DESC (_thread_db_##type##_##field, \
 	      offsetof (type, field), ((type *) 0)->field)
+#define DB_STRUCT_FLEXIBLE_ARRAY(type, field) \
+  FLEXIBLE_ARRAY_DESC (_thread_db_##type##_##field, \
+		       offsetof (type, field), ((type *) 0)->field)
 #define DB_VARIABLE(name) DESC (_thread_db_##name, 0, name)
 #define DB_ARRAY_VARIABLE(name) ARRAY_DESC (_thread_db_##name, 0, name)
 #define DB_SYMBOL(name)	/* Nothing.  */