 +            _exit(-1);
 +        }
 +
-+        shmem = (struct shmem_data*) mmap(0, SHM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-+        if (shmem == MAP_FAILED) {
++        __shmem = (struct shmem_data*) mmap(0, SHM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
++        if (__shmem == MAP_FAILED) {
 +            fprintf(stderr, "[COV] Failed to mmap shared memory region\n");
 +            _exit(-1);
 +        }

                      is_heap_oom
diff --git a/src/d8/cov.cc b/src/d8/cov.cc
new file mode 100644
index 0000000000..9ddbc618d3
--- /dev/null
+++ b/src/d8/cov.cc
@@ -0,0 +1,64 @@

+    __edges_stop = stop;
+    __sanitizer_cov_reset_edgeguards();
+
+    __shmem->num_edges = static_cast<uint32_t>(stop - start);
+    printf("[COV] edge counters initialized. Shared memory: %s with %u edges\n", shm_key, __shmem->num_edges);
+}
+
+extern "C" void __sanitizer_cov_trace_pc_guard(uint32_t *guard) {
