return 0;
 }
 #ifdef MCOUNT_SORT_ENABLED
+pthread_t mcount_sort_thread;
+
 struct elf_mcount_loc {
        Elf_Ehdr *ehdr;
        Elf_Shdr *init_data_sec;
        unsigned int shnum;
        unsigned int shstrndx;
 #ifdef MCOUNT_SORT_ENABLED
-       struct elf_mcount_loc mstruct;
+       struct elf_mcount_loc mstruct = {0};
        uint_t _start_mcount_loc = 0;
        uint_t _stop_mcount_loc = 0;
-       pthread_t mcount_sort_thread;
 #endif
 #if defined(SORTTABLE_64) && defined(UNWINDER_ORC_ENABLED)
        unsigned int orc_ip_size = 0;