Index: uspace/Makefile.common
===================================================================
--- uspace/Makefile.common	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/Makefile.common	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -187,5 +187,5 @@
 
 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS)
-	$(LD) -N $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS)
+	$(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS)
 ifeq ($(CONFIG_STRIP_BINARIES),y)
 	$(STRIP) $(BINARY)
Index: uspace/app/klog/klog.c
===================================================================
--- uspace/app/klog/klog.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/app/klog/klog.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -118,9 +118,5 @@
 	}
 	
-	/*
-	 * Mode "a" would be definitively much better here, but it is
-	 * not well supported by the FAT driver.
-	 */
-	log = fopen(LOG_FNAME, "w");
+	log = fopen(LOG_FNAME, "a");
 	if (log == NULL)
 		printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME,
Index: uspace/app/stats/stats.c
===================================================================
--- uspace/app/stats/stats.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/app/stats/stats.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -69,13 +69,19 @@
 	size_t i;
 	for (i = 0; i < count; i++) {
-		uint64_t resmem, virtmem, ucycles, kcycles;
-		char resmem_suffix, virtmem_suffix, usuffix, ksuffix;
-		
-		order_suffix(stats_tasks[i].resmem, &resmem, &resmem_suffix);
-		order_suffix(stats_tasks[i].virtmem, &virtmem, &virtmem_suffix);
+		uint64_t resmem;
+		uint64_t virtmem;
+		uint64_t ucycles;
+		uint64_t kcycles;
+		const char *resmem_suffix;
+		const char *virtmem_suffix;
+		char usuffix;
+		char ksuffix;
+		
+		bin_order_suffix(stats_tasks[i].resmem, &resmem, &resmem_suffix, true);
+		bin_order_suffix(stats_tasks[i].virtmem, &virtmem, &virtmem_suffix, true);
 		order_suffix(stats_tasks[i].ucycles, &ucycles, &usuffix);
 		order_suffix(stats_tasks[i].kcycles, &kcycles, &ksuffix);
 		
-		printf("%-8" PRIu64 " %7zu %9" PRIu64 "%c %8" PRIu64 "%c"
+		printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s %6" PRIu64 "%s"
 		    " %8" PRIu64 "%c %8" PRIu64 "%c %s\n",
 		    stats_tasks[i].task_id, stats_tasks[i].threads,
Index: uspace/app/tester/Makefile
===================================================================
--- uspace/app/tester/Makefile	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/app/tester/Makefile	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -49,4 +49,5 @@
 	loop/loop1.c \
 	mm/malloc1.c \
+	mm/malloc2.c \
 	devs/devman1.c \
 	hw/misc/virtchar1.c \
Index: uspace/app/tester/mm/malloc2.c
===================================================================
--- uspace/app/tester/mm/malloc2.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
+++ uspace/app/tester/mm/malloc2.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2011 Jakub Jermar 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <malloc.h>
+#include "../tester.h"
+
+const char *test_malloc2(void)
+{
+	int cnt = 0;
+	char *p;
+
+	TPRINTF("Provoking the kernel into overcommitting memory to us...\n");
+	while ((p = malloc(1024 * 1024))) {
+		TPRINTF("%dM ", ++cnt);
+		*p = 'A';
+	}
+	TPRINTF("\nWas refused more memory as expected.\n");
+
+	return NULL;
+}
Index: uspace/app/tester/mm/malloc2.def
===================================================================
--- uspace/app/tester/mm/malloc2.def	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
+++ uspace/app/tester/mm/malloc2.def	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -0,0 +1,6 @@
+{
+	"malloc2",
+	"Memory reservation feature test",
+	&test_malloc2,
+	false	
+},
Index: uspace/app/tester/tester.c
===================================================================
--- uspace/app/tester/tester.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/app/tester/tester.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -62,4 +62,5 @@
 #include "loop/loop1.def"
 #include "mm/malloc1.def"
+#include "mm/malloc2.def"
 #include "hw/serial/serial1.def"
 #include "hw/misc/virtchar1.def"
Index: uspace/app/tester/tester.h
===================================================================
--- uspace/app/tester/tester.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/app/tester/tester.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -78,4 +78,5 @@
 extern const char *test_loop1(void);
 extern const char *test_malloc1(void);
+extern const char *test_malloc2(void);
 extern const char *test_serial1(void);
 extern const char *test_virtchar1(void);
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/app/top/screen.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -254,16 +254,16 @@
 	uint64_t used;
 	uint64_t free;
-	char total_suffix;
-	char unavail_suffix;
-	char used_suffix;
-	char free_suffix;
-	
-	order_suffix(data->physmem->total, &total, &total_suffix);
-	order_suffix(data->physmem->unavail, &unavail, &unavail_suffix);
-	order_suffix(data->physmem->used, &used, &used_suffix);
-	order_suffix(data->physmem->free, &free, &free_suffix);
-	
-	printf("memory: %" PRIu64 "%c total, %" PRIu64 "%c unavail, %"
-	    PRIu64 "%c used, %" PRIu64 "%c free", total, total_suffix,
+	const char *total_suffix;
+	const char *unavail_suffix;
+	const char *used_suffix;
+	const char *free_suffix;
+	
+	bin_order_suffix(data->physmem->total, &total, &total_suffix, false);
+	bin_order_suffix(data->physmem->unavail, &unavail, &unavail_suffix, false);
+	bin_order_suffix(data->physmem->used, &used, &used_suffix, false);
+	bin_order_suffix(data->physmem->free, &free, &free_suffix, false);
+	
+	printf("memory: %" PRIu64 "%s total, %" PRIu64 "%s unavail, %"
+	    PRIu64 "%s used, %" PRIu64 "%s free", total, total_suffix,
 	    unavail, unavail_suffix, used, used_suffix, free, free_suffix);
 	screen_newline();
@@ -295,15 +295,15 @@
 		
 		uint64_t resmem;
-		char resmem_suffix;
-		order_suffix(task->resmem, &resmem, &resmem_suffix);
+		const char *resmem_suffix;
+		bin_order_suffix(task->resmem, &resmem, &resmem_suffix, true);
 		
 		uint64_t virtmem;
-		char virtmem_suffix;
-		order_suffix(task->virtmem, &virtmem, &virtmem_suffix);
-		
-		printf("%-8" PRIu64 " %7zu %9" PRIu64 "%c ",
+		const char *virtmem_suffix;
+		bin_order_suffix(task->virtmem, &virtmem, &virtmem_suffix, true);
+		
+		printf("%-8" PRIu64 " %7zu %7" PRIu64 "%s ",
 		    task->task_id, task->threads, resmem, resmem_suffix);
 		print_percent(perc->resmem, 2);
-		printf(" %8" PRIu64 "%c ", virtmem, virtmem_suffix);
+		printf(" %6" PRIu64 "%s ", virtmem, virtmem_suffix);
 		print_percent(perc->virtmem, 2);
 		puts(" ");
Index: uspace/lib/block/libblock.c
===================================================================
--- uspace/lib/block/libblock.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/block/libblock.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -51,4 +51,6 @@
 #include <macros.h>
 #include <mem.h>
+#include <malloc.h>
+#include <stdio.h>
 #include <sys/typefmt.h>
 #include <stacktrace.h>
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/Makefile	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -113,5 +113,6 @@
 	generic/arg_parse.c \
 	generic/sort.c \
-	generic/stats.c
+	generic/stats.c \
+	generic/assert.c \
 
 SOURCES = \
Index: uspace/lib/c/arch/ia32/include/config.h
===================================================================
--- uspace/lib/c/arch/ia32/include/config.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia32/include/config.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -36,6 +36,9 @@
 #define LIBC_ia32_CONFIG_H_
 
-#define PAGE_WIDTH	12
-#define PAGE_SIZE	(1 << PAGE_WIDTH)
+#define PAGE_WIDTH  12
+#define PAGE_SIZE   (1 << PAGE_WIDTH)
+
+#define USER_ADDRESS_SPACE_START_ARCH  UINT32_C(0x00000000)
+#define USER_ADDRESS_SPACE_END_ARCH    UINT32_C(0x7fffffff)
 
 #endif
Index: uspace/lib/c/arch/ia32/include/ddi.h
===================================================================
--- uspace/lib/c/arch/ia32/include/ddi.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia32/include/ddi.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -37,5 +37,5 @@
 #include <libarch/types.h>
 
-#define IO_SPACE_BOUNDARY	((void *) (64 * 1024))
+#define IO_SPACE_BOUNDARY  ((void *) (64 * 1024))
 
 static inline uint8_t pio_read_8(ioport8_t *port)
Index: uspace/lib/c/arch/ia32/include/faddr.h
===================================================================
--- uspace/lib/c/arch/ia32/include/faddr.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia32/include/faddr.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -38,5 +38,5 @@
 #include <libarch/types.h>
 
-#define FADDR(fptr)		((uintptr_t) (fptr))
+#define FADDR(fptr)  ((uintptr_t) (fptr))
 
 #endif
Index: uspace/lib/c/arch/ia32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/ia32/include/fibril.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia32/include/fibril.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -42,5 +42,5 @@
  * panic sooner or later
  */
-#define SP_DELTA     (12)
+#define SP_DELTA  12
 
 #define context_set(c, _pc, stack, size, ptls) \
@@ -51,6 +51,7 @@
 		(c)->ebp = 0; \
 	} while (0)
-	
-/* We include only registers that must be preserved
+
+/*
+ * We include only registers that must be preserved
  * during function call
  */
Index: uspace/lib/c/arch/ia32/src/stacktrace.c
===================================================================
--- uspace/lib/c/arch/ia32/src/stacktrace.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia32/src/stacktrace.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -35,16 +35,16 @@
  */
 
+#include <libarch/config.h>
 #include <sys/types.h>
 #include <bool.h>
-
 #include <stacktrace.h>
 
-#define FRAME_OFFSET_FP_PREV	0
-#define FRAME_OFFSET_RA		4
+#define FRAME_OFFSET_FP_PREV  0
+#define FRAME_OFFSET_RA       4
 
 bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp)
 {
 	(void) st;
-	return fp != 0;
+	return (fp != 0) && (fp <= USER_ADDRESS_SPACE_END_ARCH);
 }
 
Index: uspace/lib/c/arch/ia64/_link.ld.in
===================================================================
--- uspace/lib/c/arch/ia64/_link.ld.in	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia64/_link.ld.in	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -22,5 +22,6 @@
 	
 	.got : {
-		_gp = .;
+		/* Tell the linker where we expect GP to point. */
+		__gp = .;
 		*(.got .got.*);
 	} :data
Index: uspace/lib/c/arch/ia64/src/entry.s
===================================================================
--- uspace/lib/c/arch/ia64/src/entry.s	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia64/src/entry.s	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -39,5 +39,5 @@
 __entry:
 	alloc loc0 = ar.pfs, 0, 1, 2, 0
-	movl gp = _gp
+	movl gp = __gp
 	
 	# Pass PCB pointer as the first argument to __main
Index: uspace/lib/c/arch/ia64/src/thread_entry.s
===================================================================
--- uspace/lib/c/arch/ia64/src/thread_entry.s	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/arch/ia64/src/thread_entry.s	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -37,5 +37,5 @@
 	alloc loc0 = ar.pfs, 0, 1, 1, 0
 
-	movl gp = _gp
+	movl gp = __gp
 	
 	#
Index: uspace/lib/c/generic/assert.c
===================================================================
--- uspace/lib/c/generic/assert.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
+++ uspace/lib/c/generic/assert.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stacktrace.h>
+
+void assert_abort(const char *cond, const char *file, unsigned int line)
+{
+	printf("Assertion failed (%s) in file \"%s\", line %u.\n",
+	    cond, file, line);
+	stacktrace_print();
+	abort();
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/async.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -102,4 +102,6 @@
 #include <arch/barrier.h>
 #include <bool.h>
+#include <stdlib.h>
+#include <malloc.h>
 #include "private/async.h"
 
Index: uspace/lib/c/generic/async_sess.c
===================================================================
--- uspace/lib/c/generic/async_sess.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/async_sess.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -105,4 +105,5 @@
 #include <errno.h>
 #include <assert.h>
+#include <async.h>
 #include "private/async_sess.h"
 
Index: uspace/lib/c/generic/errno.c
===================================================================
--- uspace/lib/c/generic/errno.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/errno.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -36,5 +36,10 @@
 #include <fibril.h>
 
-int _errno;
+static fibril_local int fibril_errno;
+
+int *__errno(void)
+{
+	return &fibril_errno;
+}
 
 /** @}
Index: uspace/lib/c/generic/fibril_synch.c
===================================================================
--- uspace/lib/c/generic/fibril_synch.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/fibril_synch.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -43,4 +43,5 @@
 #include <stacktrace.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include "private/async.h"
 
Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/io/io.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -173,4 +173,5 @@
 		}
 		*flags = (O_APPEND | O_CREAT) | (plus ? O_RDWR : O_WRONLY);
+		break;
 	default:
 		errno = EINVAL;
Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/malloc.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -44,4 +44,5 @@
 #include <mem.h>
 #include <futex.h>
+#include <stdlib.h>
 #include <adt/gcdlcm.h>
 #include "private/malloc.h"
Index: uspace/lib/c/generic/stacktrace.c
===================================================================
--- uspace/lib/c/generic/stacktrace.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/stacktrace.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -61,9 +61,11 @@
 	stacktrace_prepare();
 	stacktrace_print_fp_pc(stacktrace_fp_get(), stacktrace_pc_get());
+	
 	/*
 	 * Prevent the tail call optimization of the previous call by
 	 * making it a non-tail call.
 	 */
-	(void) stacktrace_fp_get();
+	
+	printf("-- end of stack trace --\n");
 }
 
Index: uspace/lib/c/generic/str.c
===================================================================
--- uspace/lib/c/generic/str.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/generic/str.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -1215,21 +1215,21 @@
 void order_suffix(const uint64_t val, uint64_t *rv, char *suffix)
 {
-	if (val > 10000000000000000000ULL) {
-		*rv = val / 1000000000000000000ULL;
+	if (val > UINT64_C(10000000000000000000)) {
+		*rv = val / UINT64_C(1000000000000000000);
 		*suffix = 'Z';
-	} else if (val > 1000000000000000000ULL) {
-		*rv = val / 1000000000000000ULL;
+	} else if (val > UINT64_C(1000000000000000000)) {
+		*rv = val / UINT64_C(1000000000000000);
 		*suffix = 'E';
-	} else if (val > 1000000000000000ULL) {
-		*rv = val / 1000000000000ULL;
+	} else if (val > UINT64_C(1000000000000000)) {
+		*rv = val / UINT64_C(1000000000000);
 		*suffix = 'T';
-	} else if (val > 1000000000000ULL) {
-		*rv = val / 1000000000ULL;
+	} else if (val > UINT64_C(1000000000000)) {
+		*rv = val / UINT64_C(1000000000);
 		*suffix = 'G';
-	} else if (val > 1000000000ULL) {
-		*rv = val / 1000000ULL;
+	} else if (val > UINT64_C(1000000000)) {
+		*rv = val / UINT64_C(1000000);
 		*suffix = 'M';
-	} else if (val > 1000000ULL) {
-		*rv = val / 1000ULL;
+	} else if (val > UINT64_C(1000000)) {
+		*rv = val / UINT64_C(1000);
 		*suffix = 'k';
 	} else {
@@ -1239,4 +1239,31 @@
 }
 
+void bin_order_suffix(const uint64_t val, uint64_t *rv, const char **suffix,
+    bool fixed)
+{
+	if (val > UINT64_C(1152921504606846976)) {
+		*rv = val / UINT64_C(1125899906842624);
+		*suffix = "EiB";
+	} else if (val > UINT64_C(1125899906842624)) {
+		*rv = val / UINT64_C(1099511627776);
+		*suffix = "TiB";
+	} else if (val > UINT64_C(1099511627776)) {
+		*rv = val / UINT64_C(1073741824);
+		*suffix = "GiB";
+	} else if (val > UINT64_C(1073741824)) {
+		*rv = val / UINT64_C(1048576);
+		*suffix = "MiB";
+	} else if (val > UINT64_C(1048576)) {
+		*rv = val / UINT64_C(1024);
+		*suffix = "KiB";
+	} else {
+		*rv = val;
+		if (fixed)
+			*suffix = "B  ";
+		else
+			*suffix = "B";
+	}
+}
+
 /** @}
  */
Index: uspace/lib/c/include/assert.h
===================================================================
--- uspace/lib/c/include/assert.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/include/assert.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -40,5 +40,5 @@
  *
  * If NDEBUG is not set, the assert() macro
- * evaluates expr and if it is false prints 
+ * evaluates expr and if it is false prints
  * error message and terminate program.
  *
@@ -47,16 +47,10 @@
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-
 #ifndef NDEBUG
 
 #define assert(expr) \
 	do { \
-		if (!(expr)) { \
-			printf("Assertion failed (%s) at file '%s', " \
-			    "line %d.\n", #expr, __FILE__, __LINE__); \
-			abort(); \
-		} \
+		if (!(expr)) \
+			assert_abort(#expr, __FILE__, __LINE__); \
 	} while (0)
 
@@ -67,4 +61,7 @@
 #endif /* NDEBUG */
 
+extern void assert_abort(const char *, const char *, unsigned int)
+    __attribute__((noreturn));
+
 #endif
 
Index: uspace/lib/c/include/errno.h
===================================================================
--- uspace/lib/c/include/errno.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/include/errno.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -39,7 +39,7 @@
 #include <fibril.h>
 
-#define errno _errno
+#define errno  (*(__errno()))
 
-extern int _errno;
+extern int *__errno(void) __attribute__((const));
 
 #define EMFILE        (-18)
Index: uspace/lib/c/include/fibril_synch.h
===================================================================
--- uspace/lib/c/include/fibril_synch.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/include/fibril_synch.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -36,12 +36,12 @@
 #define LIBC_FIBRIL_SYNCH_H_
 
-#include <async.h>
 #include <fibril.h>
 #include <adt/list.h>
 #include <libarch/tls.h>
 #include <sys/time.h>
+#include <bool.h>
 
 typedef struct {
-	fibril_owner_info_t oi;		/* Keep this the first thing. */
+	fibril_owner_info_t oi;  /**< Keep this the first thing. */
 	int counter;
 	link_t waiters;
@@ -64,5 +64,5 @@
 
 typedef struct {
-	fibril_owner_info_t oi;	/* Keep this the first thing. */
+	fibril_owner_info_t oi;  /**< Keep this the first thing. */
 	unsigned writers;
 	unsigned readers;
Index: uspace/lib/c/include/macros.h
===================================================================
--- uspace/lib/c/include/macros.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/include/macros.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -39,9 +39,6 @@
 #define max(a, b)  ((a) > (b) ? (a) : (b))
 
-#define SIZE2KB(size)  ((size) >> 10)
-#define SIZE2MB(size)  ((size) >> 20)
-
-#define KB2SIZE(kb)  ((kb) << 10)
-#define MB2SIZE(mb)  ((mb) << 20)
+#define KiB2SIZE(kb)  ((kb) << 10)
+#define MiB2SIZE(mb)  ((mb) << 20)
 
 #define STRING(arg)      STRING_ARG(arg)
Index: uspace/lib/c/include/str.h
===================================================================
--- uspace/lib/c/include/str.h	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/lib/c/include/str.h	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -89,5 +89,6 @@
 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *);
 
-extern void order_suffix(const uint64_t val, uint64_t *rv, char *suffix);
+extern void order_suffix(const uint64_t, uint64_t *, char *);
+extern void bin_order_suffix(const uint64_t, uint64_t *, const char **, bool);
 
 /*
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/devman/devman.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -39,4 +39,5 @@
 #include <devmap.h>
 #include <str_error.h>
+#include <stdio.h>
 
 #include "devman.h"
Index: uspace/srv/fs/fat/fat_fat.c
===================================================================
--- uspace/srv/fs/fat/fat_fat.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/fs/fat/fat_fat.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -47,4 +47,5 @@
 #include <assert.h>
 #include <fibril_synch.h>
+#include <malloc.h>
 #include <mem.h>
 
Index: uspace/srv/fs/fat/fat_idx.c
===================================================================
--- uspace/srv/fs/fat/fat_idx.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/fs/fat/fat_idx.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -44,4 +44,5 @@
 #include <assert.h>
 #include <fibril_synch.h>
+#include <malloc.h>
 
 /** Each instance of this type describes one interval of freed VFS indices. */
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/fs/fat/fat_ops.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -55,4 +55,5 @@
 #include <sys/mman.h>
 #include <align.h>
+#include <malloc.h>
 
 #define FAT_NODE(node)	((node) ? (fat_node_t *) (node)->data : NULL)
Index: uspace/srv/hw/netif/ne2000/dp8390.c
===================================================================
--- uspace/srv/hw/netif/ne2000/dp8390.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/hw/netif/ne2000/dp8390.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -53,4 +53,5 @@
 #include <byteorder.h>
 #include <errno.h>
+#include <stdio.h>
 #include <libarch/ddi.h>
 #include <net/packet.h>
Index: uspace/srv/loader/arch/ia64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ia64/_link.ld.in	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/loader/arch/ia64/_link.ld.in	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -28,5 +28,6 @@
 	
 	.got : {
-		_gp = .;
+		/* Tell the linker where we expect GP to point. */
+		__gp = .;
 		*(.got .got.*);
 	} :data
Index: uspace/srv/ns/clonable.c
===================================================================
--- uspace/srv/ns/clonable.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/ns/clonable.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -78,5 +78,5 @@
 	if (list_empty(&cs_req)) {
 		/* There was no pending connection request. */
-		printf(NAME ": Unexpected clonable server.\n");
+		printf("%s: Unexpected clonable server.\n", NAME);
 		ipc_answer_0(callid, EBUSY);
 		return;
Index: uspace/srv/ns/service.c
===================================================================
--- uspace/srv/ns/service.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/ns/service.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -35,4 +35,6 @@
 #include <assert.h>
 #include <errno.h>
+#include <stdio.h>
+#include <malloc.h>
 #include "service.h"
 #include "ns.h"
Index: uspace/srv/ns/task.c
===================================================================
--- uspace/srv/ns/task.c	(revision 6b40ea7dd1a7cdce929c1950e81a47e4b91a89b7)
+++ uspace/srv/ns/task.c	(revision 30c400582d588fe7571fc86db6dacfdffd30486a)
@@ -39,4 +39,5 @@
 #include <stdio.h>
 #include <macros.h>
+#include <malloc.h>
 #include "task.h"
 #include "ns.h"
