crypto: crc32: Optimize dynamic CRC table generation
In barebox we have an option for dynamic formation of the CRC32
table (DYNAMIC_CRC_TABLE), but the source code declares a static
array which is simply filled with data, the resulting code becomes
even more than without DYNAMIC_CRC_TABLE option, due to the BSS usage.
CONFIG_DYNAMIC_CRC_TABLE=n
   text    data     bss     dec     hex filename
   1884       0       0    1884     75c crc32.o
CONFIG_DYNAMIC_CRC_TABLE=y
   text    data     bss     dec     hex filename
   1066       4    1024    2094     82e crc32.o

This patch provides dynamic buffer allocation for the CRC table,
which saves about 1 Kbyte, as it should be.
CONFIG_DYNAMIC_CRC_TABLE=y
   text    data     bss     dec     hex filename
   1062       0       4    1066     42a crc32.o

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent c672fda commit 2049dbb6fe55b6bd42e18dc9853c5b9dafc5149d
@Alexander Shiyan Alexander Shiyan authored on 19 Jun 2016
Sascha Hauer committed on 5 Jul 2016
Showing 1 changed file
View
crypto/crc32.c