From ec70c011557d0964dfc528d2d326d75526aec123 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 6 Feb 2002 00:55:46 +0000 Subject: Update. * elf/dl-load.c (_dl_map_object_from_fd): Prevent dynamically loading modules with the DF_STATIC_TLS flag set. * elf/dynamic-link.h (elf_get_dynamic_info): Initialize l_flags element. * include/link.h (struct link_map): Add l_flags field. * elf/elf.h (DF_STATIC_TLS): New definition. --- elf/dl-load.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'elf/dl-load.c') diff --git a/elf/dl-load.c b/elf/dl-load.c index a4e2421b6c..6f9ce05d46 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1170,7 +1170,11 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp, /* Make sure we are dlopen()ing an object which has the DF_1_NOOPEN flag set. */ - if (__builtin_expect (l->l_flags_1 & DF_1_NOOPEN, 0) + if ((__builtin_expect (l->l_flags_1 & DF_1_NOOPEN, 0) +#ifdef USE_TLS + || __builtin_expect (l->l_flags & DF_STATIC_TLS, 0) +#endif + ) && (mode & __RTLD_DLOPEN)) { /* We are not supposed to load this object. Free all resources. */ -- cgit v1.2.3