2002-09-29 Roland McGrath <roland@redhat.com>
[glibc.git] / sysdeps / unix / sysv / linux / x86_64 / sysdep.S
blob00086ca1e4e275124697bf20f8d248d06c752f8c
1 /* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, write to the Free
16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307 USA.  */
19 #include <sysdep.h>
20 #include <tls.h>
22 /* The Linux version is in fact x86-64/ELF and the start.? file for this
23    system (sysdeps/x86_64/elf/start.S) is also used by The Hurd.  This file
24    must not contain the definition of the `errno' variable, we have to
25    define it somewhere else.
27    ...and this place is here.  */
28 #if USE_TLS && HAVE___THREAD
29         .section .tbss
30 #else
31         .bss
32 #endif
33         .globl  errno
34         .type errno,@object
35         .size errno,4
36         .globl  _errno
37         .type _errno,@object
38         .size _errno,4
39         .align 4
40 errno:
41 _errno:
42         .space  4
45 /* The following code is only used in the shared library when we
46    compile the reentrant version.  Otherwise each system call defines
47    each own version.  */
49 #ifndef PIC
51 /* The syscall stubs jump here when they detect an error.
52    The code for Linux is almost identical to the canonical Unix
53    code, except that the error number in %rax is negated.  */
55 #undef CALL_MCOUNT
56 #define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %rax.  */
58         .text
59 ENTRY (__syscall_error)
60         negq %rax
62 #define __syscall_error __syscall_error_1
63 #include <sysdeps/unix/x86_64/sysdep.S>
65 #endif  /* !PIC */