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