diff --git a/Cargo.lock b/Cargo.lock
index 89a734c9bb..3826ae1c6f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -675,6 +675,16 @@ version = "2.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
+[[package]]
+name = "memmap"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
+dependencies = [
+ "libc",
+ "winapi 0.3.8",
+]
+
[[package]]
name = "memoffset"
version = "0.5.4"
@@ -1112,6 +1122,7 @@ dependencies = [
"difference",
"goblin",
"libloading",
+ "memmap",
"ra_mbe",
"ra_proc_macro",
"ra_tt",
diff --git a/crates/ra_proc_macro_srv/Cargo.toml b/crates/ra_proc_macro_srv/Cargo.toml
index 1e0f503392..ac2d156dc2 100644
--- a/crates/ra_proc_macro_srv/Cargo.toml
+++ b/crates/ra_proc_macro_srv/Cargo.toml
@@ -14,6 +14,7 @@ ra_mbe = { path = "../ra_mbe" }
ra_proc_macro = { path = "../ra_proc_macro" }
goblin = "0.2.1"
libloading = "0.6.0"
+memmap = "0.7"
test_utils = { path = "../test_utils" }
[dev-dependencies]
diff --git a/crates/ra_proc_macro_srv/src/dylib.rs b/crates/ra_proc_macro_srv/src/dylib.rs
index 7d6e5d3239..16bd7466e3 100644
--- a/crates/ra_proc_macro_srv/src/dylib.rs
+++ b/crates/ra_proc_macro_srv/src/dylib.rs
@@ -1,10 +1,12 @@
//! Handles dynamic library loading for proc macro
use crate::{proc_macro::bridge, rustc_server::TokenStream};
+use std::fs::File;
use std::path::Path;
use goblin::{mach::Mach, Object};
use libloading::Library;
+use memmap::Mmap;
use ra_proc_macro::ProcMacroKind;
use std::io::Error as IoError;
@@ -21,7 +23,8 @@ fn is_derive_registrar_symbol(symbol: &str) -> bool {
}
fn find_registrar_symbol(file: &Path) -> Result