summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwez <wez@1665872d-e22b-0410-9e5d-a57ad4215e6d>2010-06-26 23:00:02 +0000
committerwez <wez@1665872d-e22b-0410-9e5d-a57ad4215e6d>2010-06-26 23:00:02 +0000
commit39a56503b09a4a810b1ffce4bdf0fb6efc5fe08f (patch)
tree113f5d0702fea74e3e83658de038fbc664c062b7
parentb433a814549547e192301f6760721a5e3c782bc4 (diff)
downloadportableumem-39a56503b09a4a810b1ffce4bdf0fb6efc5fe08f.tar.gz
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. git-svn-id: https://labs.omniti.com/portableumem/trunk@60 1665872d-e22b-0410-9e5d-a57ad4215e6d
-rw-r--r--umem.c3
1 files changed, 2 insertions, 1 deletions
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);