access _dl_starting_up directly from within the loader to avoid a GLOB_DAT relocation within the loader
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 08 Apr 2011 10:34:50 +0200
changeset 612 39e5ab552e42
parent 611 615ac4ec14d6
child 613 267c8460e8ea
access _dl_starting_up directly from within the loader to avoid a GLOB_DAT relocation within the loader
glibc.c
--- a/glibc.c	Fri Apr 08 10:34:20 2011 +0200
+++ b/glibc.c	Fri Apr 08 10:34:50 2011 +0200
@@ -29,7 +29,11 @@
 // why we bother with it.
 // XXX: check on a couple more systems if we can't
 // get rid of it.
-EXPORT int _dl_starting_up = 0 ;
+static int __dl_starting_up = 0 ;
+// and, then, we define the exported symbol as an alias to the local symbol.
+extern __typeof (__dl_starting_up) _dl_starting_up __attribute__ ((alias("__dl_starting_up"), 
+								   visibility("default")));
+
 // Set to the end of the main stack (the stack allocated
 // by the kernel). Must be constant. Is used by libpthread 
 // _and_ the ELF loader to make the main stack executable
@@ -210,7 +214,7 @@
 
 void glibc_startup_finished (void) 
 {
-  _dl_starting_up = 1;
+  __dl_starting_up = 1;
 }