'Scan and track all unresolved external symbols in the module and
allocate memory for it.'

def scan_unresolved_symbols(self, module, engine):

    prefix = self.PREFIX
    for gv in module.global_variables:
        if gv.name.startswith(prefix):
            sym = gv.name[len(prefix):]
            if engine.get_global_value_address(gv.name):
                continue
            abortfn = engine.get_function_address('nrt_unresolved_abort')
            ptr = ctypes.c_void_p(abortfn)
            engine.add_global_mapping(gv, ctypes.addressof(ptr))
            self._unresolved[sym] = ptr
