diff --git a/Cargo.toml b/Cargo.toml
index 7771ee6d35d5cfb921e5a45896211030bb9aa514..9136ca634b4ce2e4a8c951f08aa4c8d5c76d9c0a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,5 +26,6 @@ default-features = false
 
 [features]
 default = []
+doc = []
 live = []
 multi_core = []
diff --git a/src/lib.rs b/src/lib.rs
index d0a1a2250082e03926418557cda24410a56e3920..6f7376b9afb5eaa1224a372978c963a543236a41 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -61,6 +61,7 @@ pub mod context;
 pub mod devices;
 
 /// ELF file parsing
+#[cfg(not(feature="doc"))]
 pub mod elf;
 
 /// External functions
@@ -70,6 +71,7 @@ pub mod externs;
 pub mod memory;
 
 /// Panic
+#[cfg(not(any(feature="doc", test)))]
 pub mod panic;
 
 /// Schemes, filesystem handlers
diff --git a/src/panic.rs b/src/panic.rs
index 8ec88a85166b266bd24af7cd5173544a17cf51cb..a04cf8f627fd0d66fce9e132c84ed7cac6afd71d 100644
--- a/src/panic.rs
+++ b/src/panic.rs
@@ -2,11 +2,9 @@
 
 use interrupt;
 
-#[cfg(not(test))]
 #[lang = "eh_personality"]
 pub extern "C" fn eh_personality() {}
 
-#[cfg(not(test))]
 /// Required to handle panics
 #[lang = "panic_fmt"]
 #[no_mangle]
diff --git a/src/syscall/process.rs b/src/syscall/process.rs
index 4c6249110f4851fe61a3766fe8c236e8d2329b4c..8a56b24fc64be3490340c4207c88a3ec8a23f2cc 100644
--- a/src/syscall/process.rs
+++ b/src/syscall/process.rs
@@ -15,6 +15,7 @@ use interrupt;
 use context;
 use context::ContextId;
 use context::file::FileDescriptor;
+#[cfg(not(feature="doc"))]
 use elf::{self, program_header};
 use scheme::FileHandle;
 use syscall;