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>
#include <unistd.h>
#include "atexit.h"
-extern __noreturn(*__exit_handler) (int);
static struct atexit *__atexit_list;
static __noreturn on_exit_exit(int rv)
as->next = __atexit_list;
__atexit_list = as;
- __exit_handler = on_exit_exit;
-
return 0;
}
+++ /dev/null
-/*
- * 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