Subject: LK
To: None <netbsd-help@netbsd.org>
From: Phil C <pchampon@sefl.satelnet.org>
List: netbsd-help
Date: 10/18/1999 16:32:16
I do not have much experience with LKM's or with ld, but it definately seems
that ld is having problems loading any of my LKM's.


bsd# cd /usr/lkm
bsd# modload -v -d ./if_ipl.o 
ld -A /netbsd -e _if_ipl_lkmentry -o ./if_ipl -T 0 ./if_ipl.o
/netbsd: Definition of symbol `_fix_outcksum' (multiply defined)
/netbsd: Definition of symbol `_iplopen' (multiply defined)
/netbsd: Definition of symbol `_ap_fixseqack' (multiply defined)
/netbsd: Definition of symbol `_fr_pass' (multiply defined)
/netbsd: Definition of symbol `_send_reset' (multiply defined)
/netbsd: Definition of symbol `_fr_findgroup' (multiply defined)
/netbsd: Definition of symbol `_fr_check' (multiply defined)
/netbsd: Definition of symbol `_fr_tcptimeout' (multiply defined)
/netbsd: Definition of symbol `_ips_num' (multiply defined)
/netbsd: Definition of symbol `_ip_natsync' (multiply defined)
/netbsd: Definition of symbol `_ip_natexpire' (multiply defined)
/netbsd: Definition of symbol `_ipfr_nat_newfrag' (multiply defined)
/netbsd: Definition of symbol `_ipauth' (multiply defined)
/netbsd: Definition of symbol `_fae_list' (multiply defined)
/netbsd: Definition of symbol `_ipopts' (multiply defined)
/netbsd: Definition of symbol `_ipfr_nat_knownfrag' (multiply defined)
/netbsd: Definition of symbol `_ipfr_knownfrag' (multiply defined)
/netbsd: Definition of symbol `_mbufchainlen' (multiply defined)
/netbsd: Definition of symbol `_iplinit' (multiply defined)
/netbsd: Definition of symbol `_fr_flags' (multiply defined)
/netbsd: Definition of symbol `_ipacct' (multiply defined)
/netbsd: Definition of symbol `_nat_outlookup' (multiply defined)
/netbsd: Definition of symbol `_ipfr_fastroute' (multiply defined)
/netbsd: Definition of symbol `_nat_lookupmapip' (multiply defined)
/netbsd: Definition of symbol `_ippr_ftp_portmsg' (multiply defined)
/netbsd: Definition of symbol `_ipfr_newfrag' (multiply defined)
/netbsd: Definition of symbol `_fr_addstate' (multiply defined)
/netbsd: Definition of symbol `_fr_newauth' (multiply defined)
/netbsd: Definition of symbol `_ipl_enable' (multiply defined)
/netbsd: Definition of symbol `_iplread' (multiply defined)
/netbsd: Definition of symbol `_ap_proxies' (multiply defined)
/netbsd: Definition of symbol `_fr_auth_ioctl' (multiply defined)
/netbsd: Definition of symbol `_ipfr_fragstats' (multiply defined)
/netbsd: Definition of symbol `_ipfilter' (multiply defined)
/netbsd: Definition of symbol `_ipf_ftp_atoi' (multiply defined)
/netbsd: Definition of symbol `_fr_authstart' (multiply defined)
/netbsd: Definition of symbol `_ipfilterattach' (multiply defined)
/netbsd: Definition of symbol `_fr_icmptimeout' (multiply defined)
/netbsd: Definition of symbol `_fr_authused' (multiply defined)
/netbsd: Definition of symbol `_frflush' (multiply defined)
/netbsd: Definition of symbol `_fr_tcp_age' (multiply defined)
/netbsd: Definition of symbol `_ap_check' (multiply defined)
/netbsd: Definition of symbol `_ipl_frouteok' (multiply defined)
/netbsd: Definition of symbol `_nat_icmpinlookup' (multiply defined)
/netbsd: Definition of symbol `_fr_defnatage' (multiply defined)
/netbsd: Definition of symbol `_ipfr_forget' (multiply defined)
/netbsd: Definition of symbol `_fr_checkstate' (multiply defined)
/netbsd: Definition of symbol `_fr_tcpclosewait' (multiply defined)
/netbsd: Definition of symbol `_fr_stateunload' (multiply defined)
/netbsd: Definition of symbol `_ippr_ftp_init' (multiply defined)
/netbsd: Definition of symbol `_fr_authsize' (multiply defined)
/netbsd: Definition of symbol `_fr_defnaticmpage' (multiply defined)
/netbsd: Definition of symbol `_nat_new' (multiply defined)
/netbsd: Definition of symbol `_fr_checkauth' (multiply defined)
/netbsd: Definition of symbol `_fr_authnext' (multiply defined)
/netbsd: Definition of symbol `_nat_inlookup' (multiply defined)
/netbsd: Definition of symbol `_fr_tcpsum' (multiply defined)
/netbsd: Definition of symbol `_ap_match' (multiply defined)
/netbsd: Definition of symbol `_ip_natin' (multiply defined)
/netbsd: Definition of symbol `_fr_tcplastack' (multiply defined)
/netbsd: Definition of symbol `_fr_delgroup' (multiply defined)
/netbsd: Definition of symbol `_fr_authunload' (multiply defined)
/netbsd: Definition of symbol `_fr_state_ioctl' (multiply defined)
/netbsd: Definition of symbol `_ipf_cksum' (multiply defined)
/netbsd: Definition of symbol `_secopt' (multiply defined)
/netbsd: Definition of symbol `_nat_list' (multiply defined)
/netbsd: Definition of symbol `_fr_ipfrttl' (multiply defined)
/netbsd: Definition of symbol `_ip_natout' (multiply defined)
/netbsd: Definition of symbol `_nat_icmpin' (multiply defined)
/netbsd: Definition of symbol `_ippr_ftp_pasvmsg' (multiply defined)
/netbsd: Definition of symbol `_ippr_ftp_out' (multiply defined)
/netbsd: Definition of symbol `_frstats' (multiply defined)
/netbsd: Definition of symbol `_ipl_unreach' (multiply defined)
/netbsd: Definition of symbol `_nat_instances' (multiply defined)
/netbsd: Definition of symbol `_ap_sess_list' (multiply defined)
/netbsd: Definition of symbol `_ipl_inited' (multiply defined)
/netbsd: Definition of symbol `_fr_tcpstate' (multiply defined)
/netbsd: Definition of symbol `_aps_free' (multiply defined)
/netbsd: Definition of symbol `_fr_udptimeout' (multiply defined)
/netbsd: Definition of symbol `_fr_authend' (multiply defined)
/netbsd: Definition of symbol `_nat_ioctl' (multiply defined)
/netbsd: Definition of symbol `_fr_authexpire' (multiply defined)
/netbsd: Definition of symbol `_fr_active' (multiply defined)
/netbsd: Definition of symbol `_ap_free' (multiply defined)
/netbsd: Definition of symbol `_iplclose' (multiply defined)
/netbsd: Definition of symbol `_ipl_disable' (multiply defined)
/netbsd: Definition of symbol `_fr_timeoutstate' (multiply defined)
/netbsd: Definition of symbol `_fr_scanlist' (multiply defined)
/netbsd: Definition of symbol `_ippr_ftp_in' (multiply defined)
/netbsd: Definition of symbol `_fr_addgroup' (multiply defined)
/netbsd: Definition of symbol `_ipfr_inuse' (multiply defined)
/netbsd: Definition of symbol `_fr_tcpclosed' (multiply defined)
/netbsd: Definition of symbol `_iplioctl' (multiply defined)
/netbsd: Definition of symbol `_nat_lookupredir' (multiply defined)
/netbsd: Definition of symbol `_ipfr_slowtimer' (multiply defined)
/netbsd: Definition of symbol `_ipfr_unload' (multiply defined)
/netbsd: Definition of symbol `_ap_ok' (multiply defined)
/netbsd: Definition of symbol `_ip_natunload' (multiply defined)
/netbsd: Definition of symbol `_fr_defaultauthage' (multiply defined)
./if_ipl.o: Definition of symbol `_fix_outcksum' (multiply defined)
./if_ipl.o: Definition of symbol `_iplopen' (multiply defined)
./if_ipl.o: Definition of symbol `_ap_fixseqack' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_pass' (multiply defined)
./if_ipl.o: Definition of symbol `_send_reset' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_findgroup' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_check' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_tcptimeout' (multiply defined)
./if_ipl.o: Definition of symbol `_ips_num' (multiply defined)
./if_ipl.o: Definition of symbol `_ip_natsync' (multiply defined)
./if_ipl.o: Definition of symbol `_ip_natexpire' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_nat_newfrag' (multiply defined)
./if_ipl.o: Definition of symbol `_ipauth' (multiply defined)
./if_ipl.o: Definition of symbol `_fae_list' (multiply defined)
./if_ipl.o: Definition of symbol `_ipopts' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_nat_knownfrag' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_knownfrag' (multiply defined)
./if_ipl.o: Definition of symbol `_mbufchainlen' (multiply defined)
./if_ipl.o: Definition of symbol `_iplinit' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_flags' (multiply defined)
./if_ipl.o: Definition of symbol `_ipacct' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_outlookup' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_fastroute' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_lookupmapip' (multiply defined)
./if_ipl.o: Definition of symbol `_ippr_ftp_portmsg' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_newfrag' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_addstate' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_newauth' (multiply defined)
./if_ipl.o: Definition of symbol `_ipl_enable' (multiply defined)
./if_ipl.o: Definition of symbol `_iplread' (multiply defined)
./if_ipl.o: Definition of symbol `_ap_proxies' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_auth_ioctl' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_fragstats' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfilter' (multiply defined)
./if_ipl.o: Definition of symbol `_ipf_ftp_atoi' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_authstart' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfilterattach' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_icmptimeout' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_delgroup' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_authunload' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_state_ioctl' (multiply defined)
./if_ipl.o: Definition of symbol `_ipf_cksum' (multiply defined)
./if_ipl.o: Definition of symbol `_secopt' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_list' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_ipfrttl' (multiply defined)
./if_ipl.o: Definition of symbol `_ip_natout' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_icmpin' (multiply defined)
./if_ipl.o: Definition of symbol `_ippr_ftp_pasvmsg' (multiply defined)
./if_ipl.o: Definition of symbol `_ippr_ftp_out' (multiply defined)
./if_ipl.o: Definition of symbol `_frstats' (multiply defined)
./if_ipl.o: Definition of symbol `_ipl_unreach' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_instances' (multiply defined)
./if_ipl.o: Definition of symbol `_ap_sess_list' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_tcpidletimeout' (multiply defined)
./if_ipl.o: Definition of symbol `_fix_incksum' (multiply defined)
./if_ipl.o: Definition of symbol `_ipl_inited' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_tcpstate' (multiply defined)
./if_ipl.o: Definition of symbol `_aps_free' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_udptimeout' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_authend' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_ioctl' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_authexpire' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_active' (multiply defined)
./if_ipl.o: Definition of symbol `_ap_free' (multiply defined)
./if_ipl.o: Definition of symbol `_iplclose' (multiply defined)
./if_ipl.o: Definition of symbol `_ipl_disable' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_timeoutstate' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_scanlist' (multiply defined)
./if_ipl.o: Definition of symbol `_ippr_ftp_in' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_addgroup' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_inuse' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_tcpclosed' (multiply defined)
./if_ipl.o: Definition of symbol `_iplioctl' (multiply defined)
./if_ipl.o: Definition of symbol `_nat_lookupredir' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_slowtimer' (multiply defined)
./if_ipl.o: Definition of symbol `_ipfr_unload' (multiply defined)
./if_ipl.o: Definition of symbol `_ap_ok' (multiply defined)
./if_ipl.o: Definition of symbol `_ip_natunload' (multiply defined)
./if_ipl.o: Definition of symbol `_fr_defaultauthage' (multiply defined)
modload: can't prelink `./if_ipl.o' creating `./if_ipl'
bsd# 


I have tried this with other lkm's too, they all do the same thing... I would
also assume that this is ld's problem not modload's since I have tried to
run:

ld -A /netbsd -e _if_ipl_lkmentry -o ./if_ipl -T 0 ./if_ipl.o

on its own, and I get the same exact error... does this mean that I should be
linking to some sort of library? any help or thoughts would be appreciated.

One more thing ... where did this object file come from (if_ipl.o)? How would
one go about making their own? (Just curious, since I compiled the ipf source
and never saw this object mentioned ... I don't think?)...

thanks,
phil