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
87bc7c9
Index: b/elf/dl-init.c
87bc7c9
===================================================================
87bc7c9
--- a/elf/dl-init.c
87bc7c9
+++ b/elf/dl-init.c
87bc7c9
@@ -119,8 +119,6 @@ _dl_init (struct link_map *main_map, int
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
 }
87bc7c9
Index: b/elf/dl-support.c
87bc7c9
===================================================================
87bc7c9
--- a/elf/dl-support.c
87bc7c9
+++ b/elf/dl-support.c
87bc7c9
@@ -117,10 +117,8 @@ struct r_scope_elem _dl_initial_searchli
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;
87bc7c9
Index: b/elf/rtld.c
87bc7c9
===================================================================
87bc7c9
--- a/elf/rtld.c
87bc7c9
+++ b/elf/rtld.c
87bc7c9
@@ -214,7 +214,6 @@ audit_list_iter_next (struct audit_list_
87bc7c9
   return iter->previous->name;
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
87bc7c9
@@ -224,7 +223,6 @@ audit_list_iter_next (struct audit_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).  */
87bc7c9
@@ -898,10 +896,8 @@ dl_main (const ElfW(Phdr) *phdr,
fb633ea
   /* Process the environment variable which control the behaviour.  */
fb633ea
   process_envvars (&mode);
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
     {