blob: b28f40bb6573caadd7504b5a39016ce8bcd4da6e [file] [log] [blame]
Bruce Beare39640842011-06-20 10:29:50 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28 .text
29 .p2align 4,,15
30 .globl atexit
31 .hidden atexit
32 .type atexit, @function
33atexit:
34 pushl %ebp
35 movl %esp, %ebp
36 pushl %ebx
37 call __x86.get_pc_thunk.bx
38 addl $_GLOBAL_OFFSET_TABLE_, %ebx
39 subl $20, %esp
40 movl $0, 4(%esp)
41 movl __dso_handle@GOTOFF(%ebx), %eax
42 movl %eax, 8(%esp)
43 movl 8(%ebp), %eax
44 movl %eax, (%esp)
45 call __cxa_atexit@PLT
46 addl $20, %esp
47 popl %ebx
48 popl %ebp
49 ret
50 .size atexit, .-atexit
51
52 .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
53 .globl __x86.get_pc_thunk.bx
54 .hidden __x86.get_pc_thunk.bx
55 .type __x86.get_pc_thunk.bx, @function
56__x86.get_pc_thunk.bx:
57 nop
58 nop
59 nop
60 nop
61 nop
62 nop
63 nop
64 nop
65 movl (%esp), %ebx
66 ret