gEDA-dev: [pcb] dlsym and RTLD_GLOBAL

Igor2 igor2 at inno.bme.hu
Sat Oct 7 09:54:26 EDT 2006


DJ,

This patch enables RTLD_GLOBAL when loading an external HID. It's
important if the HID wants to load subsequent .so files and provide
symbols for them. Scriptable HID needs this as it needs to load different
.so files for different scripts.

Igor2
-------------- next part --------------
Index: hid/common/hidinit.c
===================================================================
RCS file: /cvsroot/pcb/pcb/src/hid/common/hidinit.c,v
retrieving revision 1.11
diff -u -r1.11 hidinit.c
--- hid/common/hidinit.c	7 Oct 2006 00:50:04 -0000	1.11
+++ hid/common/hidinit.c	7 Oct 2006 13:06:17 -0000
@@ -72,7 +72,7 @@
 	  && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))
 	  && S_ISREG (st.st_mode))
 	{
-	  if ((so = dlopen (path, RTLD_NOW)) == NULL)
+	  if ((so = dlopen (path, RTLD_NOW | RTLD_GLOBAL)) == NULL)
 	    {
 	      fprintf(stderr, "dl_error: %s\n", dlerror ());
 	      continue;


More information about the geda-dev mailing list