[PATCH] reduce des.c static usage from ~70k to 32 bytes

Denis Vlasenko vda.linux at googlemail.com
Sat Mar 17 01:47:00 UTC 2007


Hi.

I noticed that des.c has by far the biggest bss usage
in the whole uclibc.

Attached patch #1 moves some static variables into des_init(),
since they are only used there and there's no reason to keep them
global.

Second patch is moving all non-constant data into malloc space.
Only two pointer variables and __des_crypt's internal result buffer
remains in bss:

# size */*/des.o
   text    data     bss     dec     hex filename
   4091       0   70760   74851   12463 uClibc.t0/libcrypt/des.o
   4491       0      32    4523    11ab uClibc.t2/libcrypt/des.o

Patches are lightly run-tested.
Please apply.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.patch
Type: text/x-diff
Size: 1063 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20070317/7de7b6f8/attachment-0004.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.patch
Type: text/x-diff
Size: 18038 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20070317/7de7b6f8/attachment-0005.bin 


More information about the uClibc mailing list