summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/dynlink.c5
-rw-r--r--src/aio/aio.c5
-rw-r--r--src/exit/atexit.c5
-rw-r--r--src/ldso/dlerror.c5
-rw-r--r--src/locale/dcngettext.c5
-rw-r--r--src/locale/locale_map.c6
-rw-r--r--src/thread/sem_open.c5
-rw-r--r--src/time/__tz.c5
8 files changed, 41 insertions, 0 deletions
diff --git a/ldso/dynlink.c b/ldso/dynlink.c
index 502e52c5..61714f40 100644
--- a/ldso/dynlink.c
+++ b/ldso/dynlink.c
@@ -23,6 +23,11 @@
#include "libc.h"
#include "dynlink.h"
+#define malloc __libc_malloc
+#define calloc __libc_calloc
+#define realloc __libc_realloc
+#define free __libc_free
+
static void error(const char *, ...);
#define MAXP2(a,b) (-(-(a)&-(b)))
diff --git a/src/aio/aio.c b/src/aio/aio.c
index b488e3d6..e004f98b 100644
--- a/src/aio/aio.c
+++ b/src/aio/aio.c
@@ -11,6 +11,11 @@
#include "pthread_impl.h"
#include "aio_impl.h"
+#define malloc __libc_malloc
+#define calloc __libc_calloc
+#define realloc __libc_realloc
+#define free __libc_free
+
/* The following is a threads-based implementation of AIO with minimal
* dependence on implementation details. Most synchronization is
* performed with pthread primitives, but atomics and futex operations
diff --git a/src/exit/atexit.c b/src/exit/atexit.c
index 160d277a..fcd940fa 100644
--- a/src/exit/atexit.c
+++ b/src/exit/atexit.c
@@ -3,6 +3,11 @@
#include "libc.h"
#include "lock.h"
+#define malloc __libc_malloc
+#define calloc __libc_calloc
+#define realloc undef
+#define free undef
+
/* Ensure that at least 32 atexit handlers can be registered without malloc */
#define COUNT 32
diff --git a/src/ldso/dlerror.c b/src/ldso/dlerror.c
index d8bbfc03..c782ca6c 100644
--- a/src/ldso/dlerror.c
+++ b/src/ldso/dlerror.c
@@ -5,6 +5,11 @@
#include "dynlink.h"
#include "lock.h"
+#define malloc __libc_malloc
+#define calloc __libc_calloc
+#define realloc __libc_realloc
+#define free __libc_free
+
char *dlerror()
{
pthread_t self = __pthread_self();
diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c
index 4c304393..39a98e83 100644
--- a/src/locale/dcngettext.c
+++ b/src/locale/dcngettext.c
@@ -11,6 +11,11 @@
#include "pleval.h"
#include "lock.h"
+#define malloc __libc_malloc
+#define calloc __libc_calloc
+#define realloc undef
+#define free undef
+
struct binding {
struct binding *next;
int dirlen;
diff --git a/src/locale/locale_map.c b/src/locale/locale_map.c
index e7eede62..94f1b04e 100644
--- a/src/locale/locale_map.c
+++ b/src/locale/locale_map.c
@@ -1,10 +1,16 @@
#include <locale.h>
#include <string.h>
#include <sys/mman.h>
+#include <stdlib.h>
#include "locale_impl.h"
#include "libc.h"
#include "lock.h"
+#define malloc __libc_malloc
+#define calloc undef
+#define realloc undef
+#define free undef
+
const char *__lctrans_impl(const char *msg, const struct __locale_map *lm)
{
const char *trans = 0;
diff --git a/src/thread/sem_open.c b/src/thread/sem_open.c
index 6fb0c5b2..dad8f177 100644
--- a/src/thread/sem_open.c
+++ b/src/thread/sem_open.c
@@ -13,6 +13,11 @@
#include <pthread.h>
#include "lock.h"
+#define malloc __libc_malloc
+#define calloc __libc_calloc
+#define realloc undef
+#define free undef
+
static struct {
ino_t ino;
sem_t *sem;
diff --git a/src/time/__tz.c b/src/time/__tz.c
index 49a7371e..3044d206 100644
--- a/src/time/__tz.c
+++ b/src/time/__tz.c
@@ -7,6 +7,11 @@
#include "libc.h"
#include "lock.h"
+#define malloc __libc_malloc
+#define calloc undef
+#define realloc undef
+#define free undef
+
long __timezone = 0;
int __daylight = 0;
char *__tzname[2] = { 0, 0 };