Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I regularly create packages for Slackware Linux and part of the process is stripping binaries so that they take up less space. I find that if I strip --strip-all (or strip with no options) kernel modules, they often fail to insert:

FATAL: Error inserting cloop (/lib/modules/ Invalid module format

What level of stripping is recommended for kernel modules? If I use --strip-debug, will I remove debugging symbols that will negatively affect system performance and/or error logging?

share|improve this question
up vote 8 down vote accepted

Stripping all symbols removes the names of the symbols that the module calls. It's not going to work.

Stripping debugging symbols with strip --strip-debug *.ko (= strip -g *.ko) is safe. The kernel makefile does it for you if you run make INSTALL_MOD_STRIP=1 modules_install.

You can prevent debugging symbols being inserted in the first place by configuring your kernel with CONFIG_DEBUG_INFO not defined.

See also How do I strip local symbols from linux kernel module without breaking it?

share|improve this answer

I believe the safest approach is strip --strip-unneeded.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.