~ubuntu-branches/ubuntu/hardy/klibc/hardy-updates

« back to all changes in this revision

Viewing changes to klibc/arch/i386/exits.S

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-01-04 20:24:52 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060104202452-ec4v3n829rymukuv
Tags: 1.1.15-0ubuntu1
* New upstream version.

* Patch to fix compilation on parisc64 kernels.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# exit and _exit get included in *every* program, and gcc generates
3
 
# horrible code for them.  Yes, this only saves a few bytes, but
4
 
# it does it in every program.
5
 
#
6
 
 
7
 
#include <asm/unistd.h>
8
 
 
9
 
        .data
10
 
        .align 4
11
 
        .globl __exit_handler
12
 
        .type __exit_handler,@object
13
 
__exit_handler:
14
 
        .long _exit
15
 
        .size __exit_handler,4
16
 
 
17
 
        .text
18
 
        .align 4
19
 
        .globl exit
20
 
        .type exit,@function
21
 
exit:
22
 
        jmp *(__exit_handler)
23
 
        .size exit,.-exit
24
 
 
25
 
        /* No need to save any registers... we're exiting! */
26
 
        .text
27
 
        .align 4
28
 
        .globl _exit
29
 
        .type _exit,@function
30
 
_exit:
31
 
#ifdef _REGPARM
32
 
        movl %eax,%ebx
33
 
#else
34
 
        popl %ebx
35
 
        popl %ebx
36
 
#endif
37
 
#if __NR_exit == 1
38
 
        xorl %eax,%eax
39
 
        incl %eax
40
 
#else
41
 
        movl $__NR_exit,%eax
42
 
#endif
43
 
        int $0x80
44
 
        hlt
45
 
        .size _exit,.-exit