diff options
author | Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> | 2009-12-16 13:12:00 +0100 |
---|---|---|
committer | Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> | 2009-12-17 13:42:26 +0100 |
commit | e092e7c30464555b3fb81adc8f2f479e892b0786 (patch) | |
tree | 8aed900855f09f0e93d7808339a01816d5d798a8 /ldso/ldso/dl-elf.c | |
parent | 197b2de50d7c025b6a25e7e1cde7a5667728c15c (diff) |
check if USE_TLS is defined before use
This patch will convert all the #ifdef USE_TLS and #if USE_TLS to
#if defined(USE_TLS) && USE_TLS.
By checking if the USE_TLS is defined before checking its value will result in
correct behavior for architectures not defining this config symbol.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: Carmelo AMOROSO <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso/ldso/dl-elf.c')
-rw-r--r-- | ldso/ldso/dl-elf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c index 6bf5bbd6a..a0db63750 100644 --- a/ldso/ldso/dl-elf.c +++ b/ldso/ldso/dl-elf.c @@ -329,7 +329,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure, ElfW(Dyn) *dpnt; struct elf_resolve *tpnt; ElfW(Phdr) *ppnt; -#if USE_TLS +#if defined(USE_TLS) && USE_TLS ElfW(Phdr) *tlsppnt = NULL; #endif char *status, *header; @@ -437,7 +437,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure, } } if (ppnt->p_type == PT_TLS) { -#if USE_TLS +#if defined(USE_TLS) && USE_TLS if (ppnt->p_memsz == 0) /* Nothing to do for an empty segment. */ continue; @@ -733,7 +733,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure, tpnt->ppnt = (ElfW(Phdr) *) DL_RELOC_ADDR(tpnt->loadaddr, epnt->e_phoff); tpnt->n_phent = epnt->e_phnum; -#if USE_TLS +#if defined(USE_TLS) && USE_TLS if (tlsppnt) { _dl_debug_early("Found TLS header for %s\n", libname); #if NO_TLS_OFFSET != 0 @@ -875,7 +875,7 @@ int _dl_fixup(struct dyn_elf *rpnt, int now_flag) #if 0 /* _dl_add_to_slotinfo is called by init_tls() for initial DSO or by dlopen() for dynamically loaded DSO. */ -#if USE_TLS +#if defined(USE_TLS) && USE_TLS /* Add object to slot information data if necessasy. */ if (tpnt->l_tls_blocksize != 0 && tls_init_tp_called) _dl_add_to_slotinfo ((struct link_map *) tpnt); |