Subject: bin/20065: pppd is unable to load plugins
To: None <>
From: John F. Woods <>
List: netbsd-bugs
Date: 01/26/2003 09:08:37
>Number:         20065
>Category:       bin
>Synopsis:       pppd is unable to load plugins
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 26 06:09:01 PST 2003
>Originator:     John F. Woods
>Release:        NetBSD 1.6F
System: NetBSD 1.6F NetBSD 1.6F (JFW) #6: Sun Aug 18 12:28:13 EDT 2002 i386
Architecture: i386
Machine: i386
The pppd code has the ability to dynamically load "plugins" (shared libraries)
which can be used to extend pppd's functionality.  As compiled on NetBSD, this
capability is disabled, yet it is trivial to enable it.
Read the pppd docs.  Try it.  Read the Makefile to find out why it didn't work.
Patching the Makefile as shown below appears to be sufficient to enable plugin
functionality in pppd under NetBSD.  Three things are required:  the symbol
PLUGIN must be defined in the compilation, the linker must be told to export
dynamic symbols (so that loaded plugins can have symbols resolved), and the
object must not be stripped when installed.

In addition to changing the Makefile, pppd (as shipped) expects to load the
shared library plugins from /usr/lib/pppd/2.4.1; if there is a more appropriate
place, pathnames.h should be editted accordingly.

Index: Makefile
RCS file: /cvsroot/src/usr.sbin/pppd/pppd/Makefile,v
retrieving revision 1.30
diff -u -d -b -w -r1.30 Makefile
--- Makefile	2002/09/18 03:54:35	1.30
+++ Makefile	2003/01/26 13:58:35
@@ -14,9 +14,11 @@
 BINOWN=	root
-LDADD=	-lpcap -lcrypt -lutil
+# don't strip object so that it can load plugins
+LDADD=	-lpcap -lcrypt -lutil -Wl,--export-dynamic

 Sun Jan 26 09:01:34 EST 2003