Re: stripping symbols from modules

From: Willy Tarreau (wtarreau@free.fr)
Date: Sat Jan 27 2001 - 12:54:33 EST


Hi !

> Is there any way to strip symbols from modules .o files ?

there are many symbols you have to keep. You also have to keep modules args
and exported modules. I personnaly use this method which seems to work OK even
if it's really awful (although I'm not sure it will work under all
circumstances) :

for i in *.o; do
       objcopy -R __ksymtab -R .comment -R .note -x `nm $i |
          grep ' ? \(__module_parm_\)\|\(__ks..tab_\)' |
          sed -e 's/\(__module_parm_\)\(.*\)/\2/'
              -e 's/\(__ks..tab_\)\(.*\)/\2/' | cut -f3- -d' ' | sort -u |
          awk '{printf " -K "$1}'` $i
done

After this, I even compress the modules because you can often gain about a 2.5
ratio.

Cheers,
Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 31 2001 - 21:00:27 EST