about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-02-24 09:40:04 +0000
committerUlrich Drepper <drepper@redhat.com>1999-02-24 09:40:04 +0000
commit9a51759bdf68392631f2c3571fc2aeb0e77bd07f (patch)
tree7d13ab51a719c8ee961c6e999a61e13e4296d77a /elf
parentafe426a038512b1b7a9477eb905ab4523a1e1f85 (diff)
downloadglibc-9a51759bdf68392631f2c3571fc2aeb0e77bd07f.tar.gz
glibc-9a51759bdf68392631f2c3571fc2aeb0e77bd07f.tar.xz
glibc-9a51759bdf68392631f2c3571fc2aeb0e77bd07f.zip
Update.
1999-02-23  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* malloc/malloc.c (mALLOC_SET_STATe): Handle the case where a
	non-checked heap is restored when malloc checking was requested by
	the user.
	(struct malloc_state): Add using_malloc_checking.
	(MALLOC_STATE_VERSION): Increment minor.
	(using_malloc_checking, disallow_malloc_check): New variables.
	(__malloc_check_init): Use them.
	(mALLOC_GET_STATe): Use mALLOc to allocate the malloc_state, so
	that it can the chunk is properly instrumented when malloc
	checking is enabled.  Set the new using_malloc_checking field.
	(malloc_hook_ini): Correct signature when _LIBC is not defined.

1999-02-23  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/i386/dl-librecon.h
	(DISTINGUISH_LIB_VERSIONS): Don't relocate DT_STRTAB a second
	time.

	* elf/rtld.c (dl_main): Rename paths_initialized to rtld_is_main.
	Don't call elf_get_dynamic_info and _dl_setup_hash a second time
	if ld.so is the main program.

	* stdio-common/vfprintf.c (vfprintf): If precision or width is too
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 762cdc5ff2..40405d15af 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -340,7 +340,7 @@ dl_main (const ElfW(Phdr) *phdr,
   char *file;
   int has_interp = 0;
   unsigned int i;
-  int paths_initialized = 0;
+  int rtld_is_main = 0;
   hp_timing_t start;
   hp_timing_t stop;
   hp_timing_t diff;
@@ -368,6 +368,7 @@ dl_main (const ElfW(Phdr) *phdr,
 	 pay attention to its PT_INTERP command (we are the interpreter
 	 ourselves).  This is an easy way to test a new ld.so before
 	 installing it.  */
+      rtld_is_main = 1;
 
       /* Note the place where the dynamic linker actually came from.  */
       _dl_rtld_map.l_name = _dl_argv[0];
@@ -441,7 +442,6 @@ of this helper program; chances are you did not intend to run this program.\n\
       /* Initialize the data structures for the search paths for shared
 	 objects.  */
       _dl_init_paths (library_path);
-      paths_initialized = 1;
 
       if (__builtin_expect (mode, normal) == verify)
 	{
@@ -574,12 +574,15 @@ of this helper program; chances are you did not intend to run this program.\n\
   else
     assert (_dl_rtld_map.l_libname); /* How else did we get here?  */
 
-  /* Extract the contents of the dynamic section for easy access.  */
-  elf_get_dynamic_info (_dl_loaded->l_ld, _dl_loaded->l_addr,
-			_dl_loaded->l_info);
-  if (_dl_loaded->l_info[DT_HASH])
-    /* Set up our cache of pointers into the hash table.  */
-    _dl_setup_hash (_dl_loaded);
+  if (! rtld_is_main)
+    {
+      /* Extract the contents of the dynamic section for easy access.  */
+      elf_get_dynamic_info (_dl_loaded->l_ld, _dl_loaded->l_addr,
+			    _dl_loaded->l_info);
+      if (_dl_loaded->l_info[DT_HASH])
+	/* Set up our cache of pointers into the hash table.  */
+	_dl_setup_hash (_dl_loaded);
+    }
 
   if (__builtin_expect (mode, normal) == verify)
     {
@@ -597,7 +600,7 @@ of this helper program; chances are you did not intend to run this program.\n\
       _exit (has_interp ? 0 : 2);
     }
 
-  if (! paths_initialized)
+  if (! rtld_is_main)
     /* Initialize the data structures for the search paths for shared
        objects.  */
     _dl_init_paths (library_path);