summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn van Groningen2007-12-13 11:38:47 +0000
committerJohn van Groningen2007-12-13 11:38:47 +0000
commitd22880e3e0f5bba90820c61fba0d34aa11d58a09 (patch)
tree0232b60c3081aaaf637f89e2d11121387730702a
parentadd apupd code (diff)
export clean_init and clean_fini for initializing and finalizing
a .so in linux
-rw-r--r--istartup.s21
1 files changed, 17 insertions, 4 deletions
diff --git a/istartup.s b/istartup.s
index 177d2ca..e9ce04f 100644
--- a/istartup.s
+++ b/istartup.s
@@ -616,7 +616,8 @@ init_error:
pop d1
ret
-#ifdef _WINDOWS_
+#if defined (_WINDOWS_) || defined (LINUX)
+# ifdef _WINDOWS_
.globl @DllMain?12
@DllMain?12:
cmpl $1,8(sp)
@@ -625,6 +626,10 @@ init_error:
ret $12
DLL_PROCESS_ATTACH:
+# else
+ .globl clean_init
+clean_init:
+# endif
push d1
push a0
push a1
@@ -642,9 +647,9 @@ DLL_PROCESS_ATTACH:
mov sp,halt_sp
-#ifdef PROFILE
+# ifdef PROFILE
call init_profiler
-#endif
+# endif
mov %edi,saved_heap_p
mov %esi,saved_a_stack_p
@@ -655,8 +660,12 @@ DLL_PROCESS_ATTACH:
init_dll_error:
xor %eax,%eax
jmp exit_dll_init
-
+# ifdef _WINDOWS_
DLL_PROCESS_DETACH:
+# else
+ .globl clean_fini
+clean_fini:
+# endif
push d1
push a0
push a1
@@ -676,7 +685,11 @@ exit_dll_init:
pop a1
pop a0
pop d1
+# ifdef _WINDOWS_
ret $12
+# else
+ ret
+# endif
#endif
init_clean: