summary refs log tree commit diff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-31 02:27:07 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-31 02:27:07 +0000
commitf55727ca53308a206cf00d0442f8c57c73761899 (patch)
tree2f84991a36a3bb08ba72e31d236ce6ce8700aadf /elf/dl-close.c
parent4a6d11984d9c84cce4789412b7a79ebedede3975 (diff)
downloadglibc-f55727ca53308a206cf00d0442f8c57c73761899.tar.gz
glibc-f55727ca53308a206cf00d0442f8c57c73761899.tar.xz
glibc-f55727ca53308a206cf00d0442f8c57c73761899.zip
Update.
	* sysdeps/generic/ldsodefs.h: Add declaration for _dl_all_dirs and
	_dl_all_init_dirs.
	* include/link.h (struct r_search_path_struct): New.
	(struct link_map): Use it for l_rpath_dirs and l_runpath_dirs.
	* elf/Versions [ld] (GLIBC_2.2): Add _dl_all_dirs and
	_dl_all_init_dirs.
	* elf/dl-close.c (_dl_close): Free l_rpath_dirs and l_runpath_dirs.
	* elf/dl-libc.c (free_mem): Free _dl_all_dirs list except elements
	added at startup time.
	* elf/dl-load.c: Fix memory handling.  r_search_path_struct
	contains element to remember fact that we can free memory.
	(all_dirs): Renamed to _dl_all_dirs.  Made global.
	(_dl_init_all_dirs): New variable.
	(fillin_rpath): Save one malloc call.
	(decompose_rpath): Change interface.  New first parameter points to
	r_search_path_struct.
	(_dl_init_paths): Adjust for changes.  Mark all memory as not
	deletable.  Set _dl_init_all_paths value.
	(open_path): Remove may_free_dirs parameter.  r_search_path_elem ***
	parameter replaced with r_search_path_struct *.  Information about
	freeing now contained in r_search_path_struct.
	(_dl_map_object): Adjust for above changes.

	* elf/dl-open.c (dl_open_worker): Change format of debug info a bit.
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index 70fcb1b719..40bc6f7202 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -215,6 +215,11 @@ _dl_close (void *_map)
 	  if (imap->l_phdr_allocated)
 	    free ((void *) imap->l_phdr);
 
+	  if (imap->l_rpath_dirs.dirs != (void *) -1)
+	    free (imap->l_rpath_dirs.dirs);
+	  if (imap->l_runpath_dirs.dirs != (void *) -1)
+	    free (imap->l_runpath_dirs.dirs);
+
 	  free (imap);
 	}
     }