fb633ea
From 16552c01a66633c9e412984d9d92616bd4e5303c Mon Sep 17 00:00:00 2001
fb633ea
From: Andreas Schwab <schwab@redhat.com>
fb633ea
Date: Fri, 11 Jun 2010 11:04:11 +0200
fb633ea
Subject: [PATCH] Properly set __libc_multiple_libcs
fb633ea
fb633ea
* elf/rtld.c (_dl_starting_up): Always define.
fb633ea
(dl_main): Always set _dl_starting_up.
fb633ea
* elf/dl-support.c (_dl_starting_up): Always define.
fb633ea
* elf/dl-init.c (_dl_init): Always clear _dl_starting_up.
fb633ea
fb633ea
---
fb633ea
 ChangeLog        |    7 +++++++
fb633ea
 elf/dl-init.c    |    4 ----
fb633ea
 elf/dl-support.c |    2 --
fb633ea
 elf/rtld.c       |    4 ----
fb633ea
 4 files changed, 7 insertions(+), 10 deletions(-)
fb633ea
fb633ea
--- a/elf/dl-init.c
fb633ea
+++ b/elf/dl-init.c
fb633ea
@@ -23,11 +23,9 @@
fb633ea
 /* Type of the initializer.  */
fb633ea
 typedef void (*init_t) (int, char **, char **);
fb633ea
 
fb633ea
-#ifndef HAVE_INLINED_SYSCALLS
fb633ea
 /* Flag, nonzero during startup phase.  */
fb633ea
 extern int _dl_starting_up;
fb633ea
 extern int _dl_starting_up_internal attribute_hidden;
fb633ea
-#endif
fb633ea
 
fb633ea
 
fb633ea
 static void
fb633ea
@@ -132,9 +130,7 @@ _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.  */
fb633ea
   INTUSE(_dl_starting_up) = 0;
fb633ea
-#endif
fb633ea
 }
fb633ea
 INTDEF (_dl_init)
fb633ea
--- a/elf/dl-support.c
fb633ea
+++ b/elf/dl-support.c
fb633ea
@@ -81,10 +81,8 @@ unsigned long long _dl_load_adds;
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;
fb633ea
--- a/elf/rtld.c
fb633ea
+++ b/elf/rtld.c
fb633ea
@@ -106,7 +106,6 @@ static struct audit_list
fb633ea
   struct audit_list *next;
fb633ea
 } *audit_list;
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
fb633ea
@@ -116,7 +115,6 @@ static struct audit_list
fb633ea
    never be called.  */
fb633ea
 int _dl_starting_up = 0;
fb633ea
 INTVARDEF(_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).  */
fb633ea
@@ -929,10 +927,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.  */
fb633ea
   INTUSE(_dl_starting_up) = 1;
fb633ea
-#endif
fb633ea
 
fb633ea
   if (*user_entry == (ElfW(Addr)) ENTRY_POINT)
fb633ea
     {