aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index c65151cb56..275ad86fe0 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -21,8 +21,9 @@
#include <limits.h>
#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/mman.h>
+#include <sys/param.h>
+#include <sys/types.h>
#include <ldsodefs.h>
#include <stdio-common/_itoa.h>
@@ -120,6 +121,15 @@ realloc (void *ptr, size_t n)
assert (new == ptr);
return new;
}
+
+/* Return alligned memory block. */
+void * weak_function
+__libc_memalign (size_t align, size_t n)
+{
+ void *newp = malloc (n + align - 1);
+
+ return (void *) roundup ((uintptr_t) newp, align);
+}
/* Avoid signal frobnication in setjmp/longjmp. Keeps things smaller. */