diff options
Diffstat (limited to 'ldso/include/ldsodefs.h')
-rw-r--r-- | ldso/include/ldsodefs.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h index 4063d00f4..f17ac0ca0 100644 --- a/ldso/include/ldsodefs.h +++ b/ldso/include/ldsodefs.h @@ -62,13 +62,18 @@ extern void _dl_get_tls_static_info (size_t *sizep, size_t *alignp) extern void _dl_allocate_static_tls (struct link_map *map) internal_function attribute_hidden; +extern int _dl_try_allocate_static_tls (struct link_map* map) + internal_function attribute_hidden; /* Taken from glibc/elf/dl-reloc.c */ #define CHECK_STATIC_TLS(sym_map) \ do { \ - if (unlikely((sym_map)->l_tls_offset == NO_TLS_OFFSET)) \ + if (__builtin_expect ((sym_map)->l_tls_offset == NO_TLS_OFFSET, 0)) \ _dl_allocate_static_tls (sym_map); \ } while (0) +#define TRY_STATIC_TLS(sym_map) \ + (__builtin_expect ((sym_map)->l_tls_offset != NO_TLS_OFFSET, 1) \ + || _dl_try_allocate_static_tls (sym_map) == 0) /* These are internal entry points to the two halves of _dl_allocate_tls, only used within rtld.c itself at startup time. */ |