diff -Nurb busybox-1.1.3/Makefile busybox-1.1.3-dlsym/Makefile --- busybox-1.1.3/Makefile 2006-06-05 16:40:15.000000000 -0700 +++ busybox-1.1.3-dlsym/Makefile 2006-06-05 16:32:22.000000000 -0700 @@ -274,6 +274,7 @@ ifeq ($(strip $(CONFIG_FEATURE_SHARED_BUSYBOX)),y) LDBUSYBOX:=-L$(top_builddir) -lbusybox endif +LIBRARIES+=-ldl -rdynamic ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) $(LIBBUSYBOX_SONAME): diff -Nurb busybox-1.1.3/applets/applets.c busybox-1.1.3-dlsym/applets/applets.c --- busybox-1.1.3/applets/applets.c 2006-03-22 13:16:25.000000000 -0800 +++ busybox-1.1.3-dlsym/applets/applets.c 2006-06-05 16:38:51.000000000 -0700 @@ -32,6 +32,8 @@ #include #include "busybox.h" +#include + const char usage_messages[] = #define MAKE_USAGE @@ -454,6 +456,24 @@ if(argc==2 && !strcmp(argv[1], "--help")) bb_show_usage (); if(ENABLE_FEATURE_SUID) check_suid (applet_using); exit ((*(applet_using->main)) (argc, argv)); + } else { + char temp[64]; + void *plugin; + + applet_using = find_applet_by_name("busybox"); + + snprintf(temp,64,"/usr/lib/busybox/%s.so",name); + plugin = dlopen(temp,RTLD_NOW); + + if (!plugin) + plugin = dlopen("/usr/lib/busybox/busybox.so",RTLD_NOW); + + snprintf(temp,64,"%s_main",name); + applet_using->main = dlsym(plugin,temp); + + if(argc==2 && !strcmp(argv[1], "--help")) bb_show_usage (); + if (applet_using->main) + exit(applet_using->main(argc, argv)); } }