(root)/
glibc-2.38/
nptl/
tst-tls5.h
       1  #include <stdint.h>
       2  #include <stddef.h>
       3  
       4  struct tls_obj
       5  {
       6    const char *name;
       7    uintptr_t addr;
       8    size_t size;
       9    size_t align;
      10  };
      11  extern struct tls_obj tls_registry[];
      12  
      13  #define TLS_REGISTER(x)				\
      14  static void __attribute__((constructor))	\
      15  tls_register_##x (void)				\
      16  {						\
      17    size_t i;					\
      18    for (i = 0; tls_registry[i].name; ++i);	\
      19    tls_registry[i].name = #x;			\
      20    tls_registry[i].addr = (uintptr_t) &x;	\
      21    tls_registry[i].size = sizeof (x);		\
      22    tls_registry[i].align = __alignof__ (x);	\
      23  }