From e092e7c30464555b3fb81adc8f2f479e892b0786 Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Wed, 16 Dec 2009 13:12:00 +0100 Subject: 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 Acked-by: Carmelo AMOROSO --- ldso/ldso/dl-elf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ldso/ldso/dl-elf.c') 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); -- cgit v1.2.3