Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why the kernel modules I compiled so big ?

2,862 views
Skip to first unread message

Fanchy

unread,
Nov 5, 2011, 5:59:41 AM11/5/11
to
my platform is debian-6.0.3-amd64
I downloaded the 2.6.32 kernel source with "apt-get " and used the
same ".config" file as the "config-2.6.32-5-amd64"file in the /boot
directory,which is the config file provided by debian .
and I ran make , make modules_install
then I got a huge modules directory in " /lib/modules/2.6.32/"
It is 1.4G , whereas the "/lib/modules/2.6.32-5-amd64/" only 103M,
and the "modules.order" file in the two directories are just the
same .
It seems every single module I compiled is more than 10 times as the
counterpart in "/lib/modules/2.6.32-5-amd64/" directory

I want to know why ?

André Gillibert

unread,
Nov 5, 2011, 6:50:59 AM11/5/11
to
Maybe you've got debug information.
Compare the output of:
$ readelf -S "some_module.ko"

On the modules of the Debian kernel and your kernel.

The debug information may add quite a few .debug_* sections with
significant size.
If there's no debug info, these sections shouldn't be present, and
the .text section should be the largest one.

Debug symbols should be stripped with:
$ make INSTALL_MOD_STRIP=1 modules_install

Or you may strip .ko modules on the live file system.

--
André Gillibert

Fanchy

unread,
Nov 5, 2011, 7:10:50 AM11/5/11
to
On Nov 5, 6:50 pm, André Gillibert <MetaEntropy.removeT...@gmail.com>
wrote:
absolutely caused by the debug info

I got a much smaller module directory with
$ make INSTALL_MOD_STRIP=1 modules_install

thanks

Pierre Asselin

unread,
Nov 5, 2011, 9:34:04 PM11/5/11
to
Fanchy <li39...@gmail.com> wrote:
> my platform is debian-6.0.3-amd64
> I downloaded the 2.6.32 kernel source with "apt-get " and used the
> same ".config" file as the "config-2.6.32-5-amd64"file
> [ ... ]
> It seems every single module I compiled is more than 10 times as the
> counterpart in "/lib/modules/2.6.32-5-amd64/" directory

Try turning off CONFIG_DEBUG_INFO.
(make menuconfig, "Kernel hacking",
"Compile the kernel with debug info" .)

--
pa at panix dot com

min lee

unread,
Jun 28, 2022, 10:18:13 PM6/28/22
to
cd ${INSTALL_DIR}/lib/modules
strip $(find ./ -name "*.ko") -d
0 new messages