From: Ulrich Drepper Date: Tue, 22 Feb 2005 03:51:38 +0000 (+0000) Subject: 2005-02-21 Alan Modra X-Git-Tag: upstream/2.30~16877 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e13e33e279e193191e06811cb7ae3518d7acad1a;p=external%2Fglibc.git 2005-02-21 Alan Modra * elf/dl-reloc.c (_dl_nothread_init_static_tls): Assert that dtv array index is within bounds. * elf/dl-load.c: Do not allow PT_TLS in modules loaded in statically linked code. * sysdeps/generic/dl-tls.c [!SHARED]: Don't build _dl_next_tls_modid. * elf/Makefile: Remove rules to build and run tst-tls9-static. --- diff --git a/ChangeLog b/ChangeLog index 1253fef..a52a9ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,19 +1,19 @@ +2005-02-21 Alan Modra + + * elf/dl-reloc.c (_dl_nothread_init_static_tls): Assert that dtv + array index is within bounds. + 2005-02-21 Ulrich Drepper + * elf/dl-load.c: Do not allow PT_TLS in modules loaded in statically + linked code. + * sysdeps/generic/dl-tls.c [!SHARED]: Don't build _dl_next_tls_modid. + * elf/Makefile: Remove rules to build and run tst-tls9-static. + * elf/dl-reloc.c (_dl_nothread_init_static_tls): Avoid using THREAD_DTV multiple times, this minimally reduces code size on some archs. -2005-02-12 Simon Josefsson - - * iconvme.h: New file, extracted from toutf8.c but improved. - * iconvme.c: New file. - * toutf8.c: Include stringprep.h first, to make the compiler check - that stringprep.h is standalone. Improve comments. Replace - #include of errno.h and sys/param.h with iconvme.h. Don't define - ICONV_CONST. - (stringprep_convert): Rewrite to use iconvme.h. - 2005-02-21 Jakub Jelinek * nscd/nscd_gethst_r.c (nscd_gethst_r): Set *h_errnop to diff --git a/elf/Makefile b/elf/Makefile index 6c34d8a..e7c16f4 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -139,12 +139,7 @@ endif ifeq (yes,$(build-static)) tests-static = tst-tls1-static tst-tls2-static ifeq (yes,$(have-initfini-array)) -tests-static += tst-array1-static -endif -ifeq (yesyesyes,$(build-static)$(build-shared)$(elf)) -tests-static += tst-tls9-static -tst-tls9-static-ENV = \ - LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn +tests-static += tst-array1-static endif tests += $(tests-static) endif diff --git a/elf/dl-load.c b/elf/dl-load.c index 088b222..5c56247 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1056,6 +1056,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp, case PT_TLS: #ifdef USE_TLS +# ifdef SHARED if (ph->p_memsz == 0) /* Nothing to do for an empty segment. */ break; @@ -1083,7 +1084,6 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp, break; } -# ifdef SHARED if (l->l_prev == NULL || (mode & __RTLD_AUDIT) != 0) /* We are loading the executable itself when the dynamic linker was executed directly. The setup will happen later. */ @@ -1092,7 +1092,6 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp, /* In a static binary there is no way to tell if we dynamically loaded libpthread. */ if (GL(dl_error_catch_tsd) == &_dl_initial_error_catch_tsd) -# endif { /* We have not yet loaded libpthread. We can do the TLS setup right now! */ @@ -1125,6 +1124,12 @@ cannot allocate TLS data structures for initial thread"); _dl_deallocate_tls (tcb, 1); goto call_lose; } +# else + errval = EINVAL; + errstring = N_("\ +statically linked code cannot load module with TLS"); + goto call_lose; +# endif #endif /* Uh-oh, the binary expects TLS support but we cannot diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c index c3a58dd..140093c 100644 --- a/elf/dl-reloc.c +++ b/elf/dl-reloc.c @@ -125,6 +125,8 @@ _dl_nothread_init_static_tls (struct link_map *map) /* Fill in the DTV slot so that a later LD/GD access will find it. */ dtv_t *dtv = THREAD_DTV (); + _dl_printf("modid=%u, counter=%u\n", map->l_tls_modid, dtv[-1].counter); + assert (map->l_tls_modid <= dtv[-1].counter); dtv[map->l_tls_modid].pointer.val = dest; dtv[map->l_tls_modid].pointer.is_static = true; diff --git a/libidn/ChangeLog b/libidn/ChangeLog index daeb4bd..df3a626 100644 --- a/libidn/ChangeLog +++ b/libidn/ChangeLog @@ -1,3 +1,14 @@ +2005-02-12 Simon Josefsson + + * iconvme.h: New file, extracted from toutf8.c but improved. + * iconvme.c: New file. + * toutf8.c: Include stringprep.h first, to make the compiler check + that stringprep.h is standalone. Improve comments. Replace + #include of errno.h and sys/param.h with iconvme.h. Don't define + ICONV_CONST. + (stringprep_convert): Rewrite to use iconvme.h. + * Makefile (libcidn-routines): Add iconvme. + 2004-10-05 Ulrich Drepper * idn-stub.c (unload_libidn): Don't define outside libc. diff --git a/libidn/Makefile b/libidn/Makefile index 8e8759b..3d2ef5e 100644 --- a/libidn/Makefile +++ b/libidn/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -20,14 +20,15 @@ subdir := libidn -distribute := punycode.h stringprep.h idna.h +distribute := punycode.h stringprep.h idna.h iconvme.h routines = idn-stub extra-libs = libcidn extra-libs-others = $(extra-libs) -libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna +libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna \ + iconvme include ../Makeconfig diff --git a/sysdeps/generic/dl-tls.c b/sysdeps/generic/dl-tls.c index 099742c..ee4acb5 100644 --- a/sysdeps/generic/dl-tls.c +++ b/sysdeps/generic/dl-tls.c @@ -49,7 +49,6 @@ oom (void) { _dl_fatal_printf ("cannot allocate memory for thread-local data: ABORT\n"); } -# endif @@ -115,7 +114,6 @@ _dl_next_tls_modid (void) return result; } -# ifdef SHARED void internal_function