Index: uspace/srv/loader/elf_load.c
===================================================================
--- uspace/srv/loader/elf_load.c	(revision 59b2adb4808ec5724445deaa809570893f7fa924)
+++ uspace/srv/loader/elf_load.c	(revision 6cd3e8a85bdf3306fe1a17aa12b7c50009f1133e)
@@ -58,4 +58,6 @@
 #include "arch.h"
 
+#define DPRINTF(...)
+
 static char *error_codes[] = {
 	"no error",
@@ -107,9 +109,7 @@
 	int rc;
 
-//	printf("open and read '%s'...\n", file_name);
-
 	fd = open(file_name, O_RDONLY);
 	if (fd < 0) {
-		printf("failed opening file\n");
+		DPRINTF("failed opening file\n");
 		return -1;
 	}
@@ -172,5 +172,5 @@
 	rc = my_read(elf->fd, header, sizeof(elf_header_t));
 	if (rc < 0) {
-		printf("read error\n"); 
+		DPRINTF("Read error.\n"); 
 		return EE_INVALID;
 	}
@@ -178,5 +178,4 @@
 	elf->header = header;
 
-//	printf("ELF-load:");
 	/* Identify ELF */
 	if (header->e_ident[EI_MAG0] != ELFMAG0 ||
@@ -184,5 +183,5 @@
 	    header->e_ident[EI_MAG2] != ELFMAG2 ||
 	    header->e_ident[EI_MAG3] != ELFMAG3) {
-		printf("invalid header\n");
+		DPRINTF("Invalid header.\n");
 		return EE_INVALID;
 	}
@@ -194,10 +193,10 @@
 	    header->e_version != EV_CURRENT ||
 	    header->e_ident[EI_CLASS] != ELF_CLASS) {
-		printf("incompatible data/version/class\n");
+		DPRINTF("Incompatible data/version/class.\n");
 		return EE_INCOMPATIBLE;
 	}
 
 	if (header->e_phentsize != sizeof(elf_segment_header_t)) {
-		printf("e_phentsize:%d != %d\n", header->e_phentsize,
+		DPRINTF("e_phentsize:%d != %d\n", header->e_phentsize,
 		    sizeof(elf_segment_header_t));
 		return EE_INCOMPATIBLE;
@@ -205,5 +204,5 @@
 
 	if (header->e_shentsize != sizeof(elf_section_header_t)) {
-		printf("e_shentsize:%d != %d\n", header->e_shentsize,
+		DPRINTF("e_shentsize:%d != %d\n", header->e_shentsize,
 		    sizeof(elf_section_header_t));
 		return EE_INCOMPATIBLE;
@@ -212,10 +211,9 @@
 	/* Check if the object type is supported. */
 	if (header->e_type != ET_EXEC && header->e_type != ET_DYN) {
-		printf("Object type %d is not supported\n", header->e_type);
+		DPRINTF("Object type %d is not supported\n", header->e_type);
 		return EE_UNSUPPORTED;
 	}
 
 	/* Shared objects can be loaded with a bias */
-//	printf("Object type: %d\n", header->e_type);
 	if (header->e_type == ET_DYN)
 		elf->bias = so_bias;
@@ -223,9 +221,6 @@
 		elf->bias = 0;
 
-//	printf("Bias set to 0x%x\n", elf->bias);
 	elf->info->interp = NULL;
 	elf->info->dynamic = NULL;
-
-//	printf("parse segments\n");
 
 	/* Walk through all segment headers and process them. */
@@ -240,5 +235,5 @@
 		    sizeof(elf_segment_header_t));
 		if (rc < 0) {
-			printf("read error\n");
+			DPRINTF("Read error.\n");
 			return EE_INVALID;
 		}
@@ -249,5 +244,5 @@
 	}
 
-//	printf("parse sections\n");
+	DPRINTF("Parse sections.\n");
 
 	/* Inspect all section headers and proccess them. */
@@ -262,5 +257,5 @@
 		    sizeof(elf_section_header_t));
 		if (rc < 0) {
-			printf("read error\n");
+			DPRINTF("Read error.\n");
 			return EE_INVALID;
 		}
@@ -274,5 +269,5 @@
 	    (entry_point_t)((uint8_t *)header->e_entry + elf->bias);
 
-//	printf("done\n");
+	DPRINTF("Done.\n");
 
 	return EE_OK;
@@ -317,5 +312,5 @@
 	case PT_HIPROC:
 	default:
-		printf("segment p_type %d unknown\n", entry->p_type);
+		DPRINTF("Segment p_type %d unknown.\n", entry->p_type);
 		return EE_UNSUPPORTED;
 		break;
@@ -340,6 +335,6 @@
 	int rc;
 
-//	printf("load segment at addr 0x%x, size 0x%x\n", entry->p_vaddr,
-//		entry->p_memsz);
+	DPRINTF("Load segment at addr 0x%x, size 0x%x\n", entry->p_vaddr,
+		entry->p_memsz);
 	
 	bias = elf->bias;
@@ -348,5 +343,5 @@
 		if ((entry->p_offset % entry->p_align) !=
 		    (entry->p_vaddr % entry->p_align)) {
-			printf("align check 1 failed offset%%align=%d, "
+			DPRINTF("Align check 1 failed offset%%align=%d, "
 			    "vaddr%%align=%d\n",
 			    entry->p_offset % entry->p_align,
@@ -370,6 +365,6 @@
 	mem_sz = entry->p_memsz + (entry->p_vaddr - base);
 
-//	printf("map to p_vaddr=0x%x-0x%x...\n", entry->p_vaddr + bias,
-//	entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
+	DPRINTF("Map to p_vaddr=0x%x-0x%x.\n", entry->p_vaddr + bias,
+	entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE));
 
 	/*
@@ -380,15 +375,14 @@
 	    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
 	if (a == (void *)(-1)) {
-		printf("memory mapping failed\n");
+		DPRINTF("Memory mapping failed.\n");
 		return EE_MEMORY;
 	}
 
-//	printf("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n",
-//		entry->p_vaddr+bias, entry->p_memsz, flags, (uintptr_t)a);
+	DPRINTF("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n",
+		entry->p_vaddr+bias, entry->p_memsz, flags, (uintptr_t)a);
 
 	/*
 	 * Load segment data
 	 */
-//	printf("seek to %d\n", entry->p_offset);
 	rc = lseek(elf->fd, entry->p_offset, SEEK_SET);
 	if (rc < 0) {
@@ -397,9 +391,8 @@
 	}
 
-//	printf("read 0x%x bytes to address 0x%x\n", entry->p_filesz, entry->p_vaddr+bias);
 /*	rc = read(fd, (void *)(entry->p_vaddr + bias), entry->p_filesz);
 	if (rc < 0) { printf("read error\n"); return EE_INVALID; }*/
 
-	/* Long reads are not possible yet. Load segment picewise */
+	/* Long reads are not possible yet. Load segment piecewise. */
 
 	unsigned left, now;
@@ -413,10 +406,8 @@
 		if (now > left) now = left;
 
-//		printf("read %d...", now);
 		rc = my_read(elf->fd, dp, now);
-//		printf("->%d\n", rc);
 
 		if (rc < 0) { 
-			printf("read error\n");
+			DPRINTF("Read error.\n");
 			return EE_INVALID;
 		}
@@ -426,8 +417,7 @@
 	}
 
-//	printf("set area flags to %d\n", flags);
 	rc = as_area_change_flags((uint8_t *)entry->p_vaddr + bias, flags);
 	if (rc != 0) {
-		printf("failed to set memory area flags\n");
+		DPRINTF("Failed to set memory area flags.\n");
 		return EE_MEMORY;
 	}
@@ -466,5 +456,5 @@
 		elf->info->dynamic =
 		    (void *)((uint8_t *)entry->sh_addr + elf->bias);
-		printf("dynamic section found at 0x%x\n",
+		DPRINTF("Dynamic section found at 0x%x.\n",
 			(uintptr_t)elf->info->dynamic);
 		break;
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision 59b2adb4808ec5724445deaa809570893f7fa924)
+++ uspace/srv/loader/main.c	(revision 6cd3e8a85bdf3306fe1a17aa12b7c50009f1133e)
@@ -60,4 +60,6 @@
 #include <elf_load.h>
 
+#define DPRINTF(...)
+
 /** Pathname of the file that will be loaded */
 static char *pathname = NULL;
@@ -226,5 +228,5 @@
 	rc = elf_load_file(pathname, 0, &prog_info);
 	if (rc < 0) {
-		printf("Failed to load executable '%s'.\n", pathname);
+		DPRINTF("Failed to load executable '%s'.\n", pathname);
 		ipc_answer_0(rid, EINVAL);
 		return 1;
@@ -245,5 +247,6 @@
 	rc = elf_load_file(prog_info.interp, 0, &interp_info);
 	if (rc < 0) {
-		printf("Failed to load interpreter '%s.'\n", prog_info.interp);
+		DPRINTF("Failed to load interpreter '%s.'\n",
+		    prog_info.interp);
 		ipc_answer_0(rid, EINVAL);
 		return 1;
@@ -267,6 +270,6 @@
 	if (is_dyn_linked == true) {
 		/* Dynamically linked program */
-		printf("run dynamic linker\n");
-		printf("entry point: 0x%lx\n", interp_info.entry);
+		DPRINTF("Run ELF interpreter.\n");
+		DPRINTF("Entry point: 0x%lx\n", interp_info.entry);
 		close_console();
 
@@ -325,5 +328,5 @@
 		if ((callid & IPC_CALLID_NOTIFICATION) == 0 &&
 		    IPC_GET_METHOD(call) != IPC_M_PHONE_HUNGUP) {
-			printf("responding EINVAL to method %d\n", 
+			DPRINTF("Responding EINVAL to method %d.\n",
 			    IPC_GET_METHOD(call));
 			ipc_answer_0(callid, EINVAL);
