From patchwork Wed Dec 21 13:42:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 18612 Received: (qmail 38910 invoked by alias); 21 Dec 2016 13:42:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 38895 invoked by uid 89); 21 Dec 2016 13:42:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:__libc_, 2016-12-21 X-HELO: mx1.redhat.com Date: Wed, 21 Dec 2016 14:42:52 +0100 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] Remove unused function _dl_tls_setup User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20161221134252.E34D9401BD5F0@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) Commit 7a5e3d9d633c828d84a9535f26b202a6179978e7 (elf: Assume TLS is initialized in _dl_map_object_from_fd) removed the last call of _dl_tls_setup, but did not remove the function itself. 2016-12-21 Florian Weimer * csu/libc-tls.c (_dl_tls_setup): Remove. * elf/dl-tls.c (_dl_tls_setup): Likewise. * elf/Versions (GLIBC_PRIVATE): Remove _dl_tls_setup. * sysdeps/generic/ldsodefs.h (_dl_tls_setup): Remove declaration. diff --git a/csu/libc-tls.c b/csu/libc-tls.c index 235ac79..8f92234 100644 --- a/csu/libc-tls.c +++ b/csu/libc-tls.c @@ -216,25 +216,6 @@ __libc_setup_tls (size_t tcbsize, size_t tcbalign) init_static_tls (memsz, MAX (TLS_TCB_ALIGN, max_align)); } -/* This is called only when the data structure setup was skipped at startup, - when there was no need for it then. Now we have dynamically loaded - something needing TLS, or libpthread needs it. */ -int -internal_function -_dl_tls_setup (void) -{ - init_slotinfo (); - init_static_tls ( -#if TLS_TCB_AT_TP - TLS_TCB_SIZE, -#else - 0, -#endif - TLS_TCB_ALIGN); - return 0; -} - - /* This is the minimal initialization function used when libpthread is not used. */ void diff --git a/elf/Versions b/elf/Versions index 08f76a7..3d57e36 100644 --- a/elf/Versions +++ b/elf/Versions @@ -59,7 +59,7 @@ ld { _dl_allocate_tls; _dl_allocate_tls_init; _dl_argv; _dl_find_dso_for_object; _dl_get_tls_static_info; _dl_deallocate_tls; _dl_make_stack_executable; _dl_out_of_memory; - _dl_rtld_di_serinfo; _dl_starting_up; _dl_tls_setup; + _dl_rtld_di_serinfo; _dl_starting_up; _rtld_global; _rtld_global_ro; # Only here for gdb while a better method is developed. diff --git a/elf/dl-tls.c b/elf/dl-tls.c index 60f4c1d..97bd977 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -274,39 +274,7 @@ _dl_determine_tlsoffset (void) /* The alignment requirement for the static TLS block. */ GL(dl_tls_static_align) = max_align; } - - -/* This is called only when the data structure setup was skipped at startup, - when there was no need for it then. Now we have dynamically loaded - something needing TLS, or libpthread needs it. */ -int -internal_function -_dl_tls_setup (void) -{ - assert (GL(dl_tls_dtv_slotinfo_list) == NULL); - assert (GL(dl_tls_max_dtv_idx) == 0); - - const size_t nelem = 2 + TLS_SLOTINFO_SURPLUS; - - GL(dl_tls_dtv_slotinfo_list) - = calloc (1, (sizeof (struct dtv_slotinfo_list) - + nelem * sizeof (struct dtv_slotinfo))); - if (GL(dl_tls_dtv_slotinfo_list) == NULL) - return -1; - - GL(dl_tls_dtv_slotinfo_list)->len = nelem; - - /* Number of elements in the static TLS block. It can't be zero - because of various assumptions. The one element is null. */ - GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx) = 1; - - /* This initializes more variables for us. */ - _dl_determine_tlsoffset (); - - return 0; -} -rtld_hidden_def (_dl_tls_setup) -#endif +#endif /* SHARED */ static void * internal_function diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 288f5fe..34d7ec1 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -994,12 +994,6 @@ extern size_t _dl_count_modids (void) internal_function attribute_hidden; /* Calculate offset of the TLS blocks in the static TLS block. */ extern void _dl_determine_tlsoffset (void) internal_function attribute_hidden; -/* Set up the data structures for TLS, when they were not set up at startup. - Returns nonzero on malloc failure. - This is called from _dl_map_object_from_fd or by libpthread. */ -extern int _dl_tls_setup (void) internal_function; -rtld_hidden_proto (_dl_tls_setup) - /* Allocate memory for static TLS block (unless MEM is nonzero) and dtv. */ extern void *_dl_allocate_tls (void *mem) internal_function; rtld_hidden_proto (_dl_allocate_tls)