From 7d4d667891589a21f6e1690ad02f3bb6587939a7 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 26 Jun 2010 23:00:02 +0000 Subject: [PATCH] Change the constructor attribute to putting this function in the .init section. The constructor is called too late, and clobbers state, leading to heap corruption later. --- umem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/umem.c b/umem.c index d93fd79..1e5f715 100644 --- a/umem.c +++ b/umem.c @@ -3328,7 +3328,8 @@ fail: return (0); } -void __attribute__((constructor)) +void +__attribute__((section(".init"))) __umem_init (void) { umem_startup(NULL, 0, 0, NULL, NULL);