summaryrefslogtreecommitdiff
path: root/ldso/ldso/dl-elf.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-14 23:07:46 +0000
committerEric Andersen <andersen@codepoet.org>2004-07-14 23:07:46 +0000
commitdb5a9ef35b66e495feb4daf2e9576883dd52926f (patch)
treebb431894295e6ccb288eaf066c6297a7ac2504b1 /ldso/ldso/dl-elf.c
parentb998ae0611fc9abb6b093209a6c67aeb833e46ad (diff)
Sigh. I got things working this morning, then checked stuff in from the wrong
tree. Bad boy, No doughnut. -Erik
Diffstat (limited to 'ldso/ldso/dl-elf.c')
-rw-r--r--ldso/ldso/dl-elf.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 7f0f76c35..1abfff157 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -31,7 +31,6 @@
#include "ldso.h"
-void *(*_dl_malloc_function) (size_t size) = NULL;
#ifdef USE_CACHE
@@ -406,7 +405,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
tpnt = _dl_check_hashed_files(libname);
if (tpnt) {
if (*rpnt) {
- (*rpnt)->next = (struct dyn_elf *) _dl_malloc_function(sizeof(struct dyn_elf));
+ (*rpnt)->next = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
_dl_memset((*rpnt)->next, 0, sizeof(struct dyn_elf));
(*rpnt)->next->prev = (*rpnt);
*rpnt = (*rpnt)->next;
@@ -692,7 +691,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
* Add this object into the symbol chain
*/
if (*rpnt) {
- (*rpnt)->next = (struct dyn_elf *) _dl_malloc_function(sizeof(struct dyn_elf));
+ (*rpnt)->next = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf));
_dl_memset((*rpnt)->next, 0, sizeof(struct dyn_elf));
(*rpnt)->next->prev = (*rpnt);
*rpnt = (*rpnt)->next;
@@ -884,11 +883,12 @@ char *_dl_strdup(const char *string)
int len;
len = _dl_strlen(string);
- retval = _dl_malloc_function(len + 1);
+ retval = _dl_malloc(len + 1);
_dl_strcpy(retval, string);
return retval;
}
+void *(*_dl_malloc_function) (size_t size) = NULL;
union __align_type
{
void *p;
@@ -944,20 +944,15 @@ void *_dl_malloc(int size)
retval = _dl_malloc_addr;
_dl_malloc_addr += size;
- /*
- * Align memory to 4 byte boundary. Some platforms require this, others
- * simply get better performance.
- */
- _dl_malloc_addr = (unsigned char *)
- (((unsigned long) _dl_malloc_addr +
- __alignof__(union __align_type) - 1)
- & ~(__alignof__(union __align_type) - 1));
+ /* Align memory to 4 byte boundary. Some platforms require this,
+ * others simply get better performance. */
+ _dl_malloc_addr = (unsigned char *) (((unsigned long) _dl_malloc_addr +
+ __alignof__(union __align_type) - 1) & ~(__alignof__(union __align_type) - 1));
return retval;
}
void (*_dl_free_function) (void *p) = NULL;
-void
-_dl_free (void *p) {
+void _dl_free (void *p) {
if (_dl_free_function)
(*_dl_free_function) (p);
}