diff options
Diffstat (limited to 'ldso/include')
-rw-r--r-- | ldso/include/dl-elf.h | 20 | ||||
-rw-r--r-- | ldso/include/ldso.h | 2 | ||||
-rw-r--r-- | ldso/include/ldsodefs.h | 10 |
3 files changed, 19 insertions, 13 deletions
diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h index 076678cfc..9c2888f5b 100644 --- a/ldso/include/dl-elf.h +++ b/ldso/include/dl-elf.h @@ -104,13 +104,15 @@ extern void _dl_protect_relro (struct elf_resolve *l); # define DT_GNU_HASH_IDX (DT_RELCONT_IDX + 1) #endif -extern void _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], - void *debug_addr, DL_LOADADDR_TYPE load_off); +extern unsigned int _dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], + void *debug_addr, DL_LOADADDR_TYPE load_off); static __always_inline -void __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], - void *debug_addr, DL_LOADADDR_TYPE load_off) +unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], + void *debug_addr, DL_LOADADDR_TYPE load_off) { + unsigned int rtld_flags = 0; + for (; dpnt->d_tag; dpnt++) { if (dpnt->d_tag < DT_NUM) { dynamic_info[dpnt->d_tag] = dpnt->d_un.d_val; @@ -138,9 +140,12 @@ void __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], } else if (dpnt->d_tag < DT_LOPROC) { if (dpnt->d_tag == DT_RELOCCOUNT) dynamic_info[DT_RELCONT_IDX] = dpnt->d_un.d_val; - if (dpnt->d_tag == DT_FLAGS_1 && - (dpnt->d_un.d_val & DF_1_NOW)) - dynamic_info[DT_BIND_NOW] = 1; + if (dpnt->d_tag == DT_FLAGS_1) { + if (dpnt->d_un.d_val & DF_1_NOW) + dynamic_info[DT_BIND_NOW] = 1; + if (dpnt->d_un.d_val & DF_1_NODELETE) + rtld_flags |= RTLD_NODELETE; + } #ifdef __LDSO_GNU_HASH_SUPPORT__ if (dpnt->d_tag == DT_GNU_HASH) dynamic_info[DT_GNU_HASH_IDX] = dpnt->d_un.d_ptr; @@ -167,6 +172,7 @@ void __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info[], ADJUST_DYN_INFO(DT_GNU_HASH_IDX, load_off); #endif #undef ADJUST_DYN_INFO + return rtld_flags; } /* Reloc type classes as returned by elf_machine_type_class(). diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h index e5669057c..53bb5be9e 100644 --- a/ldso/include/ldso.h +++ b/ldso/include/ldso.h @@ -72,7 +72,7 @@ extern char *_dl_ldsopath; /* Where the shared lib loader was found extern const char *_dl_progname; /* The name of the executable being run */ extern size_t _dl_pagesize; /* Store the page size for use later */ -#ifdef USE_TLS +#if defined(USE_TLS) && USE_TLS extern void _dl_add_to_slotinfo (struct link_map *l); extern void ** __attribute__ ((const)) _dl_initial_error_catch_tsd (void); #endif diff --git a/ldso/include/ldsodefs.h b/ldso/include/ldsodefs.h index 432c7b848..0c15254c1 100644 --- a/ldso/include/ldsodefs.h +++ b/ldso/include/ldsodefs.h @@ -116,12 +116,12 @@ EXTERN void **(*_dl_error_catch_tsd) (void) __attribute__ ((const)); /* Number of additional slots in the dtv allocated. */ # define DTV_SURPLUS (14) - /* Initial dtv of the main thread, not allocated with normal malloc. */ - EXTERN void *_dl_initial_dtv; - /* Generation counter for the dtv. */ - EXTERN size_t _dl_tls_generation; +/* Initial dtv of the main thread, not allocated with normal malloc. */ +EXTERN void *_dl_initial_dtv; +/* Generation counter for the dtv. */ +EXTERN size_t _dl_tls_generation; - EXTERN void (*_dl_init_static_tls) (struct link_map *); +EXTERN void (*_dl_init_static_tls) (struct link_map *); /* We have the auxiliary vector. */ #define HAVE_AUX_VECTOR |