[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#209145: patch ldd output uglifor ness (fwd)



tags 209145 +patch
tags 209145 fixed-upstream

It seems fixed in upstream CVS.
Included patch alocates also space for terminating `\0' character.
    
Regards

	Petr


--- rtld.old	2005-01-27 09:37:20.000000000 +0100
+++ rtld.c	2005-01-27 11:41:28.000000000 +0100
@@ -1196,10 +1196,21 @@
 	  l->l_relocated = 1;
 
 	  /* Now that we have the info handy, use the DSO image's soname
-	     so this object can be looked up by name.  */
+	     so this object can be looked up by name.  Note that we do not
+	     set l_name here.  That field gives the file name of the DSO,
+	     and this DSO is not associated with any file.  */
 	  if (l->l_info[DT_SONAME] != NULL)
-	    l->l_libname->name = ((char *) D_PTR (l, l_info[DT_STRTAB])
-				  + l->l_info[DT_SONAME]->d_un.d_val);
+	    {
+	      /* Work around a kernel problem.  The kernel cannot handle
+		 addresses in the vsyscall DSO pages in writev() calls.  */
+	      const char *dsoname = ((char *) D_PTR (l, l_info[DT_STRTAB])
+				     + l->l_info[DT_SONAME]->d_un.d_val);
+	      size_t len = 1 + strlen (dsoname);
+	      char *copy = malloc (len);
+	      if (copy == NULL)
+		_dl_fatal_printf ("out of memory\n");
+	      l->l_libname->name = memcpy (copy, dsoname, len);
+	    }
 	}
     }
 #endif

Reply to: