Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Removing debugging symbols from kernel modules



On Thu, Dec 24, 2009 at 12:39:08AM +0100, Adam Hamsik wrote:
> Hi,
> On Dec,Wednesday 23 2009, at 2:23 PM, Nicolas Joly wrote:
> 
> > I recently started to use kernel modules to ease developpement on my
> > amd64 machine. For now i only used compat linux and linux32 ones,
> > which worked flawlessly (since recent build fixes). Now, i'm trying to
> > use all the remaining compat modules. But ...
> > 
> > I can load a few modules (mostly 3 or 4), but then all other fail with
> > ENOMEM. The problem is that kernel modules are build, in my case, with
> > debugging support just like the whole userland; and quickly eat all
> > the reserved kernel space for module loading.
> 
> Good catch I have found this problem with zfs module, too. But I hacked it 
> with strip -g :) 

Here is the patch i'm currently using without any trouble yet.

And i checked that both `objdump -D' and `objdump -s' output are
identical for default vs. debug+strip build objects.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.
Index: share/mk/bsd.kmodule.mk
===================================================================
RCS file: /cvsroot/src/share/mk/bsd.kmodule.mk,v
retrieving revision 1.23
diff -u -p -r1.23 bsd.kmodule.mk
--- share/mk/bsd.kmodule.mk     14 Dec 2009 08:51:16 -0000      1.23
+++ share/mk/bsd.kmodule.mk     24 Dec 2009 13:09:42 -0000
@@ -76,7 +76,7 @@ ${_PROG}:     .MADE                                   # no 
build at instal
        done
        ${INSTALL_DIR} ${KMODULEDIR}
        ${INSTALL_FILE} -o ${KMODULEOWN} -g ${KMODULEGRP} -m ${KMODULEMODE} \
-               ${.ALLSRC} ${.TARGET}
+               ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
 
 kmodinstall::  ${_PROG}
 .PHONY:                kmodinstall


Home | Main Index | Thread Index | Old Index