-#if USE_LINKER_SECTIONS
-extern struct coverage_counter *__start_coverage[];
-extern struct coverage_counter *__stop_coverage[];
-#define coverage_counters __start_coverage
-#define n_coverage_counters (__stop_coverage - __start_coverage)
-#else /* !USE_LINKER_SECTIONS */
-#define COVERAGE_COUNTER(COUNTER) \
- DECLARE_EXTERN_PER_THREAD_DATA(unsigned int, \
- counter_##COUNTER); \
- DEFINE_EXTERN_PER_THREAD_DATA(counter_##COUNTER, 0); \
- static unsigned int COUNTER##_count(void) \
- { \
- unsigned int *countp = counter_##COUNTER##_get(); \
- unsigned int count = *countp; \
- *countp = 0; \
- return count; \
- } \
- extern struct coverage_counter counter_##COUNTER; \
- struct coverage_counter counter_##COUNTER \
- = { #COUNTER, COUNTER##_count, 0 };
-#include "coverage.def"
-#undef COVERAGE_COUNTER
-
-extern struct coverage_counter *coverage_counters[];
-struct coverage_counter *coverage_counters[] = {
-#define COVERAGE_COUNTER(NAME) &counter_##NAME,
-#include "coverage.def"
-#undef COVERAGE_COUNTER
-};
-#define n_coverage_counters ARRAY_SIZE(coverage_counters)
-#endif /* !USE_LINKER_SECTIONS */
+static struct coverage_counter **coverage_counters = NULL;
+static size_t n_coverage_counters = 0;
+static size_t allocated_coverage_counters = 0;