exit: Delete exit.S and references to __exit_handler
authorMatt Fleming <matt.fleming@linux.intel.com>
Tue, 12 Apr 2011 21:24:36 +0000 (22:24 +0100)
committerMatt Fleming <matt.fleming@linux.intel.com>
Tue, 26 Apr 2011 08:53:08 +0000 (09:53 +0100)
We stopped using exit.S (and thus __exit_handler) in 71d5d1ba646e
("elflink: change the exit.c, remove the exit.S to make process exit
working") when we moved to using the C version of _exit(). If we don't
remove the symbol __exit_handler we'll encounter undefined symbol
errors when moving libcom32.a over to an ELF shared library.

Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
com32/lib/onexit.c
com32/lib/sys/exit.S [deleted file]

index d409e82..272f8f1 100644 (file)
@@ -6,7 +6,6 @@
 #include <unistd.h>
 #include "atexit.h"
 
-extern __noreturn(*__exit_handler) (int);
 static struct atexit *__atexit_list;
 
 static __noreturn on_exit_exit(int rv)
@@ -33,7 +32,5 @@ int on_exit(void (*fctn) (int, void *), void *arg)
     as->next = __atexit_list;
     __atexit_list = as;
 
-    __exit_handler = on_exit_exit;
-
     return 0;
 }
diff --git a/com32/lib/sys/exit.S b/com32/lib/sys/exit.S
deleted file mode 100644 (file)
index 2ab8012..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Implementation of _exit() for com32 based on c32entry.S
- */
-       .text
-
-       .globl _Exit
-       .type _Exit, @function
-_Exit:
-       /* Just fall through to _exit */
-       .size _Exit, .-_Exit
-
-       .globl _exit
-       .type _exit, @function
-_exit:
-#ifdef REGPARM
-       pushl %eax
-#endif
-
-       /* Run any destructors */
-       movl $__dtors_start, %esi
-2:
-       cmpl $__dtors_end, %esi
-       jae 1f
-       call *(%esi)
-       addl $4,%esi
-       jmp 2b
-
-1:
-#ifdef REGPARM
-       popl %eax
-#else
-       movl 4(%esp),%eax               # Exit code in %eax = return value
-#endif
-       movl (__entry_esp),%esp         # Return stack pointer to entry value
-       ret                             # Return to termination address
-       .size _exit, .-_exit
-
-       .data
-__exit_handler:
-       .globl __exit_handler
-       .long _exit