e126a6
Short description: Cleanup use of _dl_starting_up.
e126a6
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
e126a6
Origin: PATCH
e126a6
Upstream status: https://sourceware.org/ml/libc-alpha/2014-02/msg00589.html
e126a6
e126a6
Upstream discussions:
e126a6
https://sourceware.org/ml/libc-alpha/2014-02/msg00580.html
e126a6
e126a6
Based on the following commit:
e126a6
~~~
e126a6
From 16552c01a66633c9e412984d9d92616bd4e5303c Mon Sep 17 00:00:00 2001
e126a6
From: Andreas Schwab <schwab@redhat.com>
e126a6
Date: Fri, 11 Jun 2010 11:04:11 +0200
e126a6
Subject: [PATCH] Properly set __libc_multiple_libcs
e126a6
e126a6
	* elf/rtld.c (_dl_starting_up): Always define.
e126a6
	(dl_main): Always set _dl_starting_up.
e126a6
	* elf/dl-support.c (_dl_starting_up): Always define.
e126a6
	* elf/dl-init.c (_dl_init): Always clear _dl_starting_up.
e126a6
e126a6
---
e126a6
ChangeLog        |    7 +++++++
e126a6
elf/dl-init.c    |    4 ----
e126a6
elf/dl-support.c |    2 --
e126a6
elf/rtld.c       |    4 ----
e126a6
4 files changed, 7 insertions(+), 10 deletions(-)
e126a6
~~~
e126a6
e126a6
This patch needs to go upstream to get cleaned up, but has always involed
e126a6
analysis of the GNU/Hurd parts of the change and that stalled out, but
e126a6
perhaps with build-many-glibcs we can now test these changes more easily.
e126a6
e126a6
Index: b/elf/dl-init.c
e126a6
===================================================================
e126a6
--- a/elf/dl-init.c
e126a6
+++ b/elf/dl-init.c
e126a6
@@ -119,8 +119,6 @@ _dl_init (struct link_map *main_map, int
e126a6
   while (i-- > 0)
e126a6
     call_init (main_map->l_initfini[i], argc, argv, env);
e126a6
 
e126a6
-#ifndef HAVE_INLINED_SYSCALLS
e126a6
   /* Finished starting up.  */
e126a6
   _dl_starting_up = 0;
e126a6
-#endif
e126a6
 }
e126a6
Index: b/elf/dl-support.c
e126a6
===================================================================
e126a6
--- a/elf/dl-support.c
e126a6
+++ b/elf/dl-support.c
e126a6
@@ -117,10 +117,8 @@ struct r_scope_elem _dl_initial_searchli
e126a6
     .r_nlist = 1,
e126a6
   };
e126a6
 
e126a6
-#ifndef HAVE_INLINED_SYSCALLS
e126a6
 /* Nonzero during startup.  */
e126a6
 int _dl_starting_up = 1;
e126a6
-#endif
e126a6
 
e126a6
 /* Random data provided by the kernel.  */
e126a6
 void *_dl_random;
e126a6
Index: b/elf/rtld.c
e126a6
===================================================================
e126a6
--- a/elf/rtld.c
e126a6
+++ b/elf/rtld.c
e126a6
@@ -214,7 +214,6 @@ audit_list_iter_next (struct audit_list_
e126a6
   return iter->previous->name;
e126a6
 }
e126a6
 
e126a6
-#ifndef HAVE_INLINED_SYSCALLS
e126a6
 /* Set nonzero during loading and initialization of executable and
e126a6
    libraries, cleared before the executable's entry point runs.  This
e126a6
    must not be initialized to nonzero, because the unused dynamic
e126a6
@@ -224,7 +223,6 @@ audit_list_iter_next (struct audit_list_
e126a6
    never be called.  */
e126a6
 int _dl_starting_up = 0;
e126a6
 rtld_hidden_def (_dl_starting_up)
e126a6
-#endif
e126a6
 
e126a6
 /* This is the structure which defines all variables global to ld.so
e126a6
    (except those which cannot be added for some reason).  */
e126a6
@@ -898,10 +896,8 @@ dl_main (const ElfW(Phdr) *phdr,
e126a6
   /* Process the environment variable which control the behaviour.  */
e126a6
   process_envvars (&mode);
e126a6
 
e126a6
-#ifndef HAVE_INLINED_SYSCALLS
e126a6
   /* Set up a flag which tells we are just starting.  */
e126a6
   _dl_starting_up = 1;
e126a6
-#endif
e126a6
 
e126a6
   if (*user_entry == (ElfW(Addr)) ENTRY_POINT)
e126a6
     {