Re: stripping symbols from modules

Willy Tarreau (wtarreau@free.fr)
Sat, 27 Jan 2001 18:54:33 +0100 (MET)


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/