From ff70f5feb0afc3b972bf040148450e87cc613ff6 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sat, 26 Nov 2016 23:54:38 +0300 Subject: [PATCH] mdbx: avoid large '.data' section in mdbx_chk. Initializes walk-array in runtime, for placing it in the '.bss' section instead of '.data'. Change-Id: I5bd1d9cabd2094f8ae517d91488840ce12844bfa --- mdb_chk.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mdb_chk.c b/mdb_chk.c index 1d800703..4fe83ff0 100644 --- a/mdb_chk.c +++ b/mdb_chk.c @@ -74,9 +74,13 @@ struct { short *pagemap; size_t total_payload_bytes; size_t pgcount; -} walk = { - .dbi_names = { "@gc" } -}; +} walk; + +static __attribute__((constructor)) +void init_walk(void) +{ + walk.dbi_names[0] = "@gc"; +} size_t total_unused_bytes; int exclusive = 2;