Index: uspace/lib/c/generic/elf/elf_load.c
===================================================================
--- uspace/lib/c/generic/elf/elf_load.c	(revision 174156fd1cf321a6363777352073d05829467b2f)
+++ uspace/lib/c/generic/elf/elf_load.c	(revision 3e828ea40985ce126affd5d7faa6ba679802b4db)
@@ -53,15 +53,15 @@
  * @param file File handle
  * @param info Place to store ELF program information
- * @return EE_OK on success or an EE_x error code
+ * @return EOK on success or an error code
  */
-int elf_load(int file, elf_info_t *info)
+errno_t elf_load(int file, elf_info_t *info)
 {
 #ifdef CONFIG_RTLD
 	rtld_t *env;
 #endif
-	int rc;
+	errno_t rc;
 
 	rc = elf_load_file(file, 0, &info->finfo);
-	if (rc != EE_OK) {
+	if (rc != EOK) {
 		DPRINTF("Failed to load executable '%s'.\n", file_name);
 		return rc;
@@ -72,5 +72,5 @@
 		DPRINTF("Binary is statically linked.\n");
 		info->env = NULL;
-		return EE_OK;
+		return EOK;
 	}
 
@@ -79,20 +79,8 @@
 	DPRINTF("- prog dynamic: %p\n", info->finfo.dynamic);
 
-	errno_t rc2 = rtld_prog_process(&info->finfo, &env);
-	switch (rc2) {
-	case EOK:
-		rc = EE_OK;
-		break;
-	case ENOMEM:
-		rc = EE_MEMORY;
-		break;
-	default:
-		DPRINTF("Unexpected error code from rtld_prog_process(): %s\n", str_error_name(rc2));
-		rc = EE_INVALID;
-	}
-
+	rc = rtld_prog_process(&info->finfo, &env);
 	info->env = env;
 #else
-	rc = EE_UNSUPPORTED;
+	rc = ENOTSUP;
 #endif
 	return rc;
