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