Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
	* 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.
  • Loading branch information
Ulrich Drepper committed Aug 31, 2000
1 parent 4a6d119 commit f55727c
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 80 deletions.
25 changes: 25 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
2000-08-30 Ulrich Drepper <drepper@redhat.com>

* 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.

* elf/dl-load.c (fillin_rpath): Only check for trusted directories
when adding new entries.

Expand Down
2 changes: 1 addition & 1 deletion elf/Versions
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ ld {
_dl_init_first;

# variables used elsewhere
_dl_out_of_memory;
_dl_out_of_memory; _dl_all_dirs; _dl_init_all_dirs;
}
}
5 changes: 5 additions & 0 deletions elf/dl-close.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
10 changes: 10 additions & 0 deletions elf/dl-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ static void
free_mem (void)
{
struct link_map *l;
struct r_search_path_elem *d;

/* Remove all search directories. */
d = _dl_all_dirs;
while (d != _dl_init_all_dirs)
{
struct r_search_path_elem *old = d;
d = d->next;
free (old);
}

/* Remove all additional names added to the objects. */
for (l = _dl_loaded; l != NULL; l = l->l_next)
Expand Down
Loading

0 comments on commit f55727c

Please sign in to comment.