An old dl patch

H.J. Lu hjl@lucon.org
Sun Aug 30 07:52:00 GMT 1998


This is a very old dl patch. The bug happens very rare. But a bug is
a bug.

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
Thu Jul 23 07:08:13 1998  H.J. Lu  <hjl@gnu.org>

	* elf/dl-open.c (_dl_open): Increment the open count if the
	shared object is put at the first place on the global scope
	list.
	Don't put the shared object on the global scope list twice.

Index: dl-open.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc-2.0/elf/dl-open.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 dl-open.c
--- dl-open.c	1998/03/31 16:18:44	1.1.1.5
+++ dl-open.c	1998/08/05 14:11:41
@@ -91,7 +91,14 @@ _dl_open (const char *file, int mode)
     }
 
   new->l_global = (mode & RTLD_GLOBAL) ? 1 : 0;
-  if (new->l_global)
+
+  if (_dl_loaded == new)
+    /* We are put at the first place on the global scope list, one way
+       or the other. We may be used by other shared objects. We have to
+       make sure that it stays in memory for them. Increment the open
+       count. */
+    new->l_opencount++;
+  else if (new->l_global)
     {
       /* The symbols of the new object and its dependencies are to be
 	 introduced into the global scope that will be used to resolve



More information about the Libc-hacker mailing list