summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/__uc_malloc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libc/stdlib/__uc_malloc.c b/libc/stdlib/__uc_malloc.c
index 121fe08a4..fcc10ed59 100644
--- a/libc/stdlib/__uc_malloc.c
+++ b/libc/stdlib/__uc_malloc.c
@@ -24,8 +24,11 @@ Cambridge, MA 02139, USA.
#include <unistd.h>
#include <malloc.h>
-void (*__uc_malloc_failed)(size_t size);
-libc_hidden_data_def(__uc_malloc_failed);
+void (*__uc_malloc_failed)(size_t size) = NULL;
+/* Seemingly superfluous assigment of NULL above prevents gas error
+ * ("__uc_malloc_failed can't be equated to common symbol
+ * __GI___uc_malloc_failed") in libc_hidden_data_def: */
+libc_hidden_data_def(__uc_malloc_failed)
void *__uc_malloc(size_t size)
{
@@ -40,4 +43,4 @@ void *__uc_malloc(size_t size)
__uc_malloc_failed(size);
}
}
-libc_hidden_def(__uc_malloc);
+libc_hidden_def(__uc_malloc)