Subject: Working on Netatalk 1.5.0 package - dlopen issues
To: None <port-sparc@netbsd.org, tech-pkg@netbsd.org>
From: David Rankin <drankin@bohemians.lexington.ky.us>
List: tech-pkg
Date: 01/03/2002 22:16:03
I've been working on a Netatalk 1.5.0 package on my NetBSD/sparc 1.5.2
box, but I've run into a problem. For afpd, "mod_load" uses dlopen and
dlsym. I've already found one problem I've patched in the process, but 
I've found that the following code:

#define mod_symbol(a, b) dlsym(a, b)

....

   if ((mod->uam_fcn = mod_symbol(module, buf)) == NULL) {
        syslog(LOG_ERR, "uam_load(%s): mod_symbol error for symbol %s: %s",
               name,
               buf,
               mod_error() );
        goto uam_load_err;
    }

produces

Jan  3 20:03:26 rumpole afpd[1672]: uam: loading (/usr/pkg/libexec/netatalk/uams/uams_clrtxt.so)
Jan  3 20:03:26 rumpole afpd[1672]: uam_load(uams_clrtxt.so): mod_symbol error for symbol uams_clrtxt: Undefined symbol "_uams_clrtxt"

I can confirm buf == "uams_clrtxt". A test program I've written confirms
that uams_clrtxt is exported correctly. I cannot confirm any cc option that
is forcing the _ in front of buf in afpd.

Anyone have any suggestions as to why afpd is sticking _uams_clrtxt
in place of uams_clrtxt in the middle of dlsym? I'd greatly appreciate it.

As before, if you want to try out the package, a copy is at 
http://www.bohemians.lexington.ky.us/~drankin/netatalk.tar , but it's not
ready for prime time yet.

Thanks,
David

-- 
David W. Rankin, Jr.     Christian, Husband, Father, and UNIX Sysadmin. 
   "We're the technical experts. We were hired so that management could
    ignore our recommendations and tell us how to do our jobs."
       -- Mike Andrews in <eUJE5.880$ln6.119642@news.flash.net>