From b998ae0611fc9abb6b093209a6c67aeb833e46ad Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 14 Jul 2004 12:27:03 +0000 Subject: Based on a patch from Alexandre Oliva, make sure _dl_malloc returns a nicely aligned pointer that may be aligned up to page_size. Also add _dl_free, --- ldso/libdl/libdl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ldso/libdl/libdl.c') diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index ca39473f1..d7cbed733 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -54,6 +54,7 @@ extern struct elf_resolve *_dl_loaded_modules __attribute__ ((__weak__)); extern struct r_debug *_dl_debug_addr __attribute__ ((__weak__)); extern unsigned long _dl_error_number __attribute__ ((__weak__)); extern void *(*_dl_malloc_function)(size_t) __attribute__ ((__weak__)); +extern void (*_dl_free_function) (void *p) __attribute__ ((__weak__)); #ifdef USE_CACHE int _dl_map_cache(void) __attribute__ ((__weak__)); int _dl_unmap_cache(void) __attribute__ ((__weak__)); @@ -95,6 +96,7 @@ struct r_debug *_dl_debug_addr = NULL; static unsigned char *_dl_malloc_addr, *_dl_mmap_zero; void *(*_dl_malloc_function) (size_t size); int _dl_errno = 0; +void (*_dl_free_function) (void *p); int _dl_fixup(struct dyn_elf *rpnt, int lazy); #include "../ldso/dl-progname.h" /* Pull in the name of ld.so */ #include "../ldso/dl-hash.c" @@ -164,6 +166,7 @@ void *_dlopen(const char *libname, int flag) if (!dl_init) { dl_init++; _dl_malloc_function = malloc; + _dl_free_function = free; } /* Cover the trivial case first */ -- cgit v1.2.3