From f5cfda977a90c5c0c24e724ddd65f54b8ac4f825 Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Sun, 4 Jan 2015 18:47:18 +0100 Subject: [PATCH 1/2] cpu/native: fix real_calloc initialization --- cpu/native/syscalls.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu/native/syscalls.c b/cpu/native/syscalls.c index f0587ce150..8c2b84cd00 100644 --- a/cpu/native/syscalls.c +++ b/cpu/native/syscalls.c @@ -378,6 +378,7 @@ void _native_init_syscalls(void) *(void **)(&real_read) = dlsym(RTLD_NEXT, "read"); *(void **)(&real_write) = dlsym(RTLD_NEXT, "write"); *(void **)(&real_malloc) = dlsym(RTLD_NEXT, "malloc"); + *(void **)(&real_calloc) = dlsym(RTLD_NEXT, "calloc"); *(void **)(&real_realloc) = dlsym(RTLD_NEXT, "realloc"); *(void **)(&real_exit) = dlsym(RTLD_NEXT, "exit"); *(void **)(&real_free) = dlsym(RTLD_NEXT, "free"); From 3ab73bc633574a2fa105fc2e6e2f767592bd11eb Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Mon, 5 Jan 2015 17:50:37 +0100 Subject: [PATCH 2/2] cpu/native: init _native_in_calloc explicitly --- cpu/native/syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/native/syscalls.c b/cpu/native/syscalls.c index 8c2b84cd00..d4fdefdb9a 100644 --- a/cpu/native/syscalls.c +++ b/cpu/native/syscalls.c @@ -145,7 +145,7 @@ void free(void *ptr) _native_syscall_leave(); } -int _native_in_calloc; +int _native_in_calloc = 0; void *calloc(size_t nmemb, size_t size) { /* dynamically load calloc when it's needed - this is necessary to