Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 2003d1abfa0c20ee77815f0da33e2c1c > files > 81

glibc-2.5-49.el5_5.5.src.rpm

2008-07-26  Ulrich Drepper  <drepper@redhat.com>

	[BZ #6763]
	* elf/dl-load.c (_dl_map_object_from_fd): Don't allocate
	l_symbolic_searchlist.r_list.
	* elf/dl-object.c (_dl_new_object): Allocate symbolic searchlist as
	part of the object.

--- libc/elf/dl-load.c	28 Oct 2007 08:23:50 -0000	1.289
+++ libc/elf/dl-load.c	26 Jul 2008 08:40:05 -0000	1.290
@@ -1470,15 +1470,6 @@ cannot enable executable stack as shared
     {
       /* Create an appropriate searchlist.  It contains only this map.
 	 This is the definition of DT_SYMBOLIC in SysVr4.  */
-      l->l_symbolic_searchlist.r_list =
-	(struct link_map **) malloc (sizeof (struct link_map *));
-
-      if (l->l_symbolic_searchlist.r_list == NULL)
-	{
-	  errstring = N_("cannot create searchlist");
-	  goto call_lose_errno;
-	}
-
       l->l_symbolic_searchlist.r_list[0] = l;
       l->l_symbolic_searchlist.r_nlist = 1;
 
--- libc/elf/dl-object.c	18 Sep 2007 19:20:28 -0000	1.45
+++ libc/elf/dl-object.c	26 Jul 2008 18:03:29 -0000	1.47
@@ -50,13 +50,17 @@ _dl_new_object (char *realname, const ch
 #endif
 
   new = (struct link_map *) calloc (sizeof (*new) + audit_space
+				    + sizeof (struct link_map *)
 				    + sizeof (*newname) + libname_len, 1);
   if (new == NULL)
     return NULL;
 
   new->l_real = new;
-  new->l_libname = newname = (struct libname_list *) ((char *) (new + 1)
-						      + audit_space);
+  new->l_symbolic_searchlist.r_list = (struct link_map **) ((char *) (new + 1)
+							    + audit_space);
+
+  new->l_libname = newname
+    = (struct libname_list *) (new->l_symbolic_searchlist.r_list + 1);
   newname->name = (char *) memcpy (newname + 1, libname, libname_len);
   /* newname->next = NULL;	We use calloc therefore not necessary.  */
   newname->dont_free = 1;