summaryrefslogtreecommitdiff
path: root/ldso/libdl/libdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldso/libdl/libdl.c')
-rw-r--r--ldso/libdl/libdl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 22b622d28..05a68ddcc 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -39,14 +39,14 @@
#include <tls.h>
#endif
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
#include <ldsodefs.h>
extern void (*_dl_init_static_tls) (struct link_map *);
extern void _dl_add_to_slotinfo(struct link_map *l);
#endif
#ifdef SHARED
-# if USE_TLS
+# if defined(USE_TLS) && USE_TLS
# include <dl-tls.h>
extern struct link_map *_dl_update_slotinfo(unsigned long int req_modid);
# endif
@@ -112,7 +112,7 @@ struct r_debug *_dl_debug_addr = NULL;
#include "../ldso/dl-debug.c"
-# if USE_TLS
+# if defined(USE_TLS) && USE_TLS
/*
* Giving this initialized value preallocates some surplus bytes in the
* static TLS area, see __libc_setup_tls (libc-tls.c).
@@ -166,7 +166,7 @@ static const char *const dl_error_names[] = {
};
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
#ifdef SHARED
/*
* Systems which do not have tls_index also probably have to define
@@ -284,7 +284,7 @@ void *dlopen(const char *libname, int flag)
unsigned int nlist, i;
struct elf_resolve **init_fini_list;
static bool _dl_init;
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
bool any_tls = false;
#endif
@@ -519,7 +519,7 @@ void *dlopen(const char *libname, int flag)
/* TODO: Should we set the protections of all pages back to R/O now ? */
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
for (i=0; i < nlist; i++) {
struct elf_resolve *tmp_tpnt = init_fini_list[i];
@@ -670,7 +670,7 @@ void *dlsym(void *vhandle, const char *name)
tpnt = handle->dyn; /* Only search RTLD_GLOBAL objs if global object */
ret = _dl_find_hash(name2, handle, NULL, 0, &tls_tpnt);
-#if defined USE_TLS && defined SHARED
+#if defined(USE_TLS) && USE_TLS && defined SHARED
if (tls_tpnt) {
/* The found symbol is a thread-local storage variable.
Return the address for to the current thread. */
@@ -709,7 +709,7 @@ static int do_dlclose(void *vhandle, int need_fini)
struct dyn_elf *handle;
unsigned int end;
unsigned int i, j;
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
bool any_tls = false;
size_t tls_free_start = NO_TLS_OFFSET;
size_t tls_free_end = NO_TLS_OFFSET;
@@ -771,7 +771,7 @@ static int do_dlclose(void *vhandle, int need_fini)
end = ppnt->p_vaddr + ppnt->p_memsz;
}
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
/* Do the cast to make things easy. */
tls_lmap = (struct link_map *) tpnt;
@@ -924,7 +924,7 @@ static int do_dlclose(void *vhandle, int need_fini)
free(handle->init_fini.init_fini);
free(handle);
-#if USE_TLS
+#if defined(USE_TLS) && USE_TLS
/* If we removed any object which uses TLS bump the generation counter. */
if (any_tls) {
if (__builtin_expect(++_dl_tls_generation == 0, 0)) {