Date: Sun, 8 Oct 1995 16:33:14 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: ache@astral.msk.su (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=) Cc: bde@zeta.org.au, current@freebsd.org Subject: Re: procfs LKM broken now! Message-ID: <199510082333.QAA07452@phaeton.artisoft.com> In-Reply-To: <AjB4-TmCJ1@ache.dialup.demos.ru> from "=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=" at Oct 8, 95 05:32:43 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> > >>It calls _divdi3 function (procfs_vnops.c) and fail to load, > >>because can't find it. Also libkern have such function, it seems > >>that procfs_vnops.c is only file which call it, so, it isn't > >>picked from libkern to kernel. > >>Workaround is to add 'options PROCFS' to kernel config file. > >>In this case _divdi3 picked from libkern. > > >This shows that a kernel library shouldn't be used if there are > >lkm's. The whole point of the library is to avoid linking to > >unused functions, but lkms might use anything in the library > >and this use is not detected when the kernel is linked. > > >Also, when individual .o's are used instead of a library, the > >list of .o's must be bloated to include everything that an lkm > >might need. > > LKM bulding can be fixed by adding divdi3.c module from libkern > directly to LKM Makefile, but I don't shure what happens if > some kernel module will use divdi3 too (in future f.e.) and LKM > tries to load function with same name. The problem is that divdi3 is not pulled in during the regular kernel link, and it should be. This is a kernel linking issue. If the kernel is supposedly exporting these services, then they must exist regardless of whetheror not they are used. The X11 code gets around this by causing references in a function code body for which the function itself is never called, but for which the object module being included is mandatory. The other alternative is a static function (which doesn't work too well with asm). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510082333.QAA07452>