@@ -62,3 +62,7 @@ config ARM_MPU
If your CPU has an MPU then you should choose 'y' here unless you
know that you do not want to use the MPU.
+
+config ZLIB_INFLATE_STACK_SAVING
+ bool 'Do not place huge encoder tables on stack' if ZLIB_INFLATE
+ depends on ZLIB_INFLATE
@@ -75,9 +75,14 @@ int zlib_inflateInit2(z_streamp strm, int windowBits)
Return state with length and distance decoding tables and index sizes set to
fixed code decoding. This returns fixed tables from inffixed.h.
*/
+#ifdef CONFIG_ZLIB_INFLATE_STACK_SAVING
+# include "inffixed.h"
+#endif
static void zlib_fixedtables(struct inflate_state *state)
{
+#ifndef CONFIG_ZLIB_INFLATE_STACK_SAVING
# include "inffixed.h"
+#endif
state->lencode = lenfix;
state->lenbits = 9;
state->distcode = distfix;
Since stack on Cortex-M3 is too small, we need configuration option to avoid using it for huge encoder tables of zlib. Signed-off-by: Paul Osmialowski <pawelo@king.net.pl> --- arch/arm/Kconfig-nommu | 4 ++++ lib/zlib_inflate/inflate.c | 5 +++++ 2 files changed, 9 insertions(+)