summary refs log tree commit diff
path: root/elf/dl-object.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-09-08 16:27:08 +0000
committerUlrich Drepper <drepper@redhat.com>2001-09-08 16:27:08 +0000
commitc4bb124a75b23d1a82cee232005dc7e8c43a4276 (patch)
tree070153ee7d895708e4e1b8c69b0d05093c19f17d /elf/dl-object.c
parent5a21d307c518c911f81848b6c0056fcc39e3ddcd (diff)
downloadglibc-c4bb124a75b23d1a82cee232005dc7e8c43a4276.tar.gz
glibc-c4bb124a75b23d1a82cee232005dc7e8c43a4276.tar.xz
glibc-c4bb124a75b23d1a82cee232005dc7e8c43a4276.zip
Update.
2001-09-08  Ulrich Drepper  <drepper@redhat.com>

	* elf/dl-close.c (_dl_close): If object has no r_list (i.e., wasn't
	loaded directly) determine length if l_initfini list by iterating
	over its elements.  Minor optimizations.
	* elf/dl-deps.c (_dl_map_object_deps): Always add own map to l_initfini
	for dependency objects.
	If object was already loaded check whether any of the dependencies
	is already on the relocation dependency list.  If yes, remove the
	latter.  Minor optimizations.
	* elf/dl-lookup.c (add_dependency): Add check for self reference of
	maps here.  Search l_initfini list only if the object was loaded
	directly and not only as a dependency.
	(_dl_lookup_symbol): Add relocation dependency also if object
	is not in global scope.  Remove test for self-reference here.
	(_dl_lookup_versioned_symbol): Likewise.
	* elf/dl-object (_dl_new_object): Cleanup.  Initialize dont_free
	element of first name record.
	* elf/loadtest.c: Add some more test to recognize early if an object
	wasn't unloaded.
	* elf/Makefile: Add rules to build and run reldep5.
	* elf/reldep5.c: New file.
	* elf/reldepmod5.c: New file.
	* elf/reldepmod6.c: New file.

	* elf/reldep2.c: Fix typo.

	* elf/dl-object.c (_dl_new_object): Initialize l_scope and l_scope_max.
Diffstat (limited to 'elf/dl-object.c')
-rw-r--r--elf/dl-object.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/elf/dl-object.c b/elf/dl-object.c
index 9c32c08ff2..65e90d66a0 100644
--- a/elf/dl-object.c
+++ b/elf/dl-object.c
@@ -37,14 +37,18 @@ _dl_new_object (char *realname, const char *libname, int type,
   struct link_map *l;
   int idx;
   size_t libname_len = strlen (libname) + 1;
-  struct link_map *new = calloc (sizeof *new, 1);
-  struct libname_list *newname = malloc (sizeof *newname + libname_len);
-  if (! new || ! newname)
+  struct link_map *new;
+  struct libname_list *newname;
+
+  new = (struct link_map *) calloc (sizeof *new, 1);
+  newname = (struct libname_list *) malloc (sizeof *newname + libname_len);
+  if (new == NULL || newname == NULL)
     return NULL;
 
   new->l_name = realname;
-  newname->name = memcpy (newname + 1, libname, libname_len);
+  newname->name = (char *) memcpy (newname + 1, libname, libname_len);
   newname->next = NULL;
+  newname->dont_free = 0;
   new->l_libname = newname;
   new->l_type = type;
   new->l_loader = loader;