Index: uspace/lib/c/generic/elf/elf_load.c
===================================================================
--- uspace/lib/c/generic/elf/elf_load.c	(revision 001667409fe983adba70256d5d79278a7e0e12bd)
+++ uspace/lib/c/generic/elf/elf_load.c	(revision 16f2dccd209e000faa95942cd1000cb27dbf408e)
@@ -53,5 +53,5 @@
  * @param file File handle 
  * @param info Place to store ELF program information
- * @return EOK on success or an error code
+ * @return EE_OK on success or an EE_x error code
  */
 int elf_load(int file, elf_info_t *info)
Index: uspace/lib/c/generic/elf/elf_mod.c
===================================================================
--- uspace/lib/c/generic/elf/elf_mod.c	(revision 001667409fe983adba70256d5d79278a7e0e12bd)
+++ uspace/lib/c/generic/elf/elf_mod.c	(revision 16f2dccd209e000faa95942cd1000cb27dbf408e)
@@ -69,5 +69,6 @@
 	"incompatible image",
 	"unsupported image type",
-	"irrecoverable error"
+	"irrecoverable error",
+	"file io error"
 };
 
@@ -90,5 +91,5 @@
  *                  extracted from the binary.
  *
- * @return EOK on success or negative error code.
+ * @return EE_OK on success or EE_xx error code.
  *
  */
@@ -103,5 +104,5 @@
 	}
 	if (rc != EOK) {
-		return rc;
+		return EE_IO;
 	}
 
@@ -110,8 +111,8 @@
 	elf.flags = flags;
 
-	rc = elf_load_module(&elf, so_bias);
+	int ret = elf_load_module(&elf, so_bias);
 
 	vfs_put(ofile);
-	return rc;
+	return ret;
 }
 
@@ -122,8 +123,10 @@
 	int rc = vfs_lookup(path, 0, &file);
 	if (rc == EOK) {
-		rc = elf_load_file(file, so_bias, flags, info);
+		int ret = elf_load_file(file, so_bias, flags, info);
 		vfs_put(file);
-	}
-	return rc;
+		return ret;
+	} else {
+		return EE_IO;
+	}
 }
 
@@ -144,10 +147,11 @@
 	aoff64_t pos = 0;
 	size_t nr;
-	int i, rc;
+	int i, ret;
+	int rc;
 
 	rc = vfs_read(elf->fd, &pos, header, sizeof(elf_header_t), &nr);
 	if (rc != EOK || nr != sizeof(elf_header_t)) {
 		DPRINTF("Read error.\n"); 
-		return EE_INVALID;
+		return EE_IO;
 	}
 
@@ -209,10 +213,10 @@
 		if (rc != EOK || nr != sizeof(elf_segment_header_t)) {
 			DPRINTF("Read error.\n");
-			return EE_INVALID;
+			return EE_IO;
 		}
 
-		rc = segment_header(elf, &segment_hdr);
-		if (rc != EE_OK)
-			return rc;
+		ret = segment_header(elf, &segment_hdr);
+		if (ret != EE_OK)
+			return ret;
 	}
 
@@ -228,10 +232,10 @@
 		if (rc != EOK || nr != sizeof(elf_section_header_t)) {
 			DPRINTF("Read error.\n");
-			return EE_INVALID;
+			return EE_IO;
 		}
 
-		rc = section_header(elf, &section_hdr);
-		if (rc != EE_OK)
-			return rc;
+		ret = section_header(elf, &section_hdr);
+		if (ret != EE_OK)
+			return ret;
 	}
 
@@ -399,5 +403,5 @@
 	if (rc != EOK || nr != entry->p_filesz) {
 		DPRINTF("read error\n");
-		return EE_INVALID;
+		return EE_IO;
 	}
 
