This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem in rtld.c with gcc-2.95pre


On Sat, Jun 12, 1999 at 12:14:30PM +0200, Franz Sirl wrote:
> Splitting _dl_start should work on all platforms, at least until compilers are
> able to inline functions across separate .c files.

Here's a hideously hacky implementation of that.  I'm not suggesting
this be included, but for anyone like me who is trying to debug other
problems in libc right now, it may come in useful.

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/
diff -uNr build/glibc-2.1.1/elf/rtld.c b/glibc-2.1.1/elf/rtld.c
--- build/glibc-2.1.1/elf/rtld.c	Tue May 11 15:07:33 1999
+++ b/glibc-2.1.1/elf/rtld.c	Thu Jun 17 17:21:21 1999
@@ -129,6 +129,10 @@
 static hp_timing_t load_time;
 extern unsigned long int _dl_num_relocations;	/* in dl-lookup.c */
 
+static ElfW(Addr)
+_end_of_dl_start (void *arg, struct link_map *bootstrap_map_p,
+                  hp_timing_t start_time);
+
 #ifdef RTLD_START
 RTLD_START
 #else
@@ -140,7 +144,6 @@
 {
   struct link_map bootstrap_map;
   hp_timing_t start_time;
-  ElfW(Addr) start_addr;
 
   /* This #define produces dynamic linking inline functions for
      bootstrap relocation instead of general-purpose relocation.  */
@@ -177,6 +180,15 @@
      the operating system's program loader where to find the program
      header table in core.  */
 
+  return _end_of_dl_start(arg, &bootstrap_map, start_time);
+}
+
+static ElfW(Addr)
+_end_of_dl_start (void *arg, struct link_map *bootstrap_map_p,
+                  hp_timing_t start_time)
+{
+  ElfW(Addr) start_addr;
+
   if (HP_TIMING_AVAIL)
     {
       /* If it hasn't happen yet record the startup time.  */
@@ -188,10 +200,10 @@
     }
 
   /* Transfer data about ourselves to the permanent link_map structure.  */
-  _dl_rtld_map.l_addr = bootstrap_map.l_addr;
-  _dl_rtld_map.l_ld = bootstrap_map.l_ld;
+  _dl_rtld_map.l_addr = bootstrap_map_p->l_addr;
+  _dl_rtld_map.l_ld = bootstrap_map_p->l_ld;
   _dl_rtld_map.l_opencount = 1;
-  memcpy (_dl_rtld_map.l_info, bootstrap_map.l_info,
+  memcpy (_dl_rtld_map.l_info, bootstrap_map_p->l_info,
 	  sizeof _dl_rtld_map.l_info);
   _dl_setup_hash (&_dl_rtld_map);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]