diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-10-22 23:29:26 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-10-22 23:29:26 +0000 |
commit | 6ed0492f8e47e2d0859105ab0f758b806853125b (patch) | |
tree | e170d5de9cfc380e13aef2c0393aa793a9423a16 /sysdeps | |
parent | 769e8a82da08831123a4b78b4bfab2c0ec042183 (diff) | |
download | glibc-6ed0492f8e47e2d0859105ab0f758b806853125b.zip glibc-6ed0492f8e47e2d0859105ab0f758b806853125b.tar.gz glibc-6ed0492f8e47e2d0859105ab0f758b806853125b.tar.bz2 |
update from main archvie 961022cvs/libc-961028cvs/libc-961027cvs/libc-961026cvs/libc-961025cvs/libc-961024cvs/libc-961023
Tue Oct 22 21:38:21 1996 Ulrich Drepper <drepper@cygnus.com>
* version.h: Bump version number to 1.97.
* features.h: Undo change of Sun Oct 20 22:19:58 1996.
Include libc-version.h.
* features.h.in: Removed.
* Makefile: Change rules to generate libc-version.h instead of
features.h.
* malloc/free.c: Add cast to prevent warning.
* malloc/malloc-walk.c: Likewise.
* malloc/ralloc.c: Likewise.
* malloc/realloc.c: Likewise.
* grp/fgetgrent_r.c: Accept empty numeric field if name start with +
or -.
* pwd/fgetpwent_r.c: Likewise.
* nss/nss_files/files-grp.c: Don't accept entries with names starting
with + or - in lookup functions.
* nss/nss_files/files-pwd.c: Likewise.
* Makerules: Call autolock.sh using $(SHELL).
Mon Oct 21 22:52:16 1996 NIIBE Yutaka <gniibe@mri.co.jp>
* elf/dl-minimal.c: Don't define `dgettext' replacement but
`dcgettext'. When optimizing the macros in <libintl.h> define
`dgettext' as a macro and so this function will never be called.
Mon Oct 21 15:41:59 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/i386/sysdep.h: Define END to use .size when available.
(PSEUDO_END): Use END.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Define PSEUDO_END to
define SYSCALL_ERROR_HANDLER before using END.
(SYSCALL_ERROR_HANDLER): Don't use .size directive.
* sysdeps/unix/sysv/linux/clone.S: Don't use SYSCALL_ERROR_HANDLER
and .size directive but PSEUDO_END.
* sysdeps/unix/sysv/linux/mmap.S: Likewise.
* sysdeps/unix/sysv/linux/socket.S: Likewise.
* sysdeps/unix/sysv/linux/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/sysdep.S (__errno_location): Use END.
* sysdeps/unix/i386/sysdep.S (__syscall_error): Likewise.
* sysdeps/i386/__longjmp.S: Use END instead of PSEUDO_END.
* sysdeps/i386/bsd-_setjmp.S: Likewise.
* sysdeps/i386/bsd-setjmp.S: Likewise.
* sysdeps/i386/memchr.S: Likewise.
* sysdeps/i386/memcmp.S: Likewise.
* sysdeps/i386/setjmp.S: Likewise.
* sysdeps/i386/stpcpy.S: Likewise.
* sysdeps/i386/stpncpy.S: Likewise.
* sysdeps/i386/strchr.S: Likewise.
* sysdeps/i386/strcspn.S: Likewise.
* sysdeps/i386/strpbrk.S: Likewise.
* sysdeps/i386/strrchr.S: Likewise.
* sysdeps/i386/strspn.S: Likewise.
* sysdeps/i386/strtok.S: Likewise.
* sysdeps/i386/i486/strcat.S: Likewise.
* sysdeps/i386/i486/strlen.S: Likewise.
* sysdeps/i386/i586/memset.S: Likewise.
* sysdeps/i386/i586/strchr.S: Likewise.
* sysdeps/i386/i586/strlen.S: Likewise.
* sysdeps/i386/strlen.c: De-ANSI-fy.
* sysdeps/generic/_strerror.c: Undo change of Mon Oct 21 01:32:36 1996.
Define dgettext if not defined to use dcgettext.
* sysdeps/mach/_strerror.c: Likewise.
* sysdeps/unix/sysv/i386/time.S: Add PSEUDO_END to get
__syscall_error defined..
Sat Oct 19 12:27:50 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/m68k/mmap.S: Fix braino: CALL_MCOUNT is
already included in the ENTRY macro. Remove SYSCALL_ERROR_HANDLER
now provided by PSEUDO_END.
* sysdeps/unix/sysv/linux/m68k/sigreturn.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/socket.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/syscall.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/clone.S: Likewise. Use JUMPTARGET.
* sysdeps/generic/sysdep.h (END): Provide default empty
definition.
* sysdeps/unix/sysv/linux/m68k/sysdep.h (END): Redefine to use
size directive.
(PSEUDO): Don't include SYSCALL_ERROR_HANDLER.
(PSEUDO_END): Include it here instead.
(SYSCALL_ERROR_HANDLER): Remove type directive.
* sysdeps/m68k/bsd-_setjmp.S: Use END, not PSEUDO_END.
* sysdeps/m68k/bsd-setjmp.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sigreturn.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise.
(__syscall_error): Can't use ENTRY macro.
Sat Oct 19 12:13:24 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/syscalls.list (getresuid, setresuid):
Set caller to EXTRA.
O_SHLOCK.
Tue Oct 15 14:37:40 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/hurd/fcntlbits.h (O_HURD): Add O_EXLOCK and
Diffstat (limited to 'sysdeps')
43 files changed, 106 insertions, 107 deletions
diff --git a/sysdeps/generic/_strerror.c b/sysdeps/generic/_strerror.c index 45fc8ca..e88d6d6 100644 --- a/sysdeps/generic/_strerror.c +++ b/sysdeps/generic/_strerror.c @@ -26,19 +26,22 @@ Cambridge, MA 02139, USA. */ #define _sys_nerr sys_nerr #endif -/* Set if startup process finished. */ -extern int _dl_starting_up; +/* It is critical here that we always use the `dcgettext' function for + the message translation. Since <libintl.h> only defines the macro + `dgettext' to use `dcgettext' for optimizing programs this is not + always guaranteed. */ +#ifndef dgettext +# include <locale.h> /* We need LC_MESSAGES. */ +# define dgettext(domainname, msgid) dcgettext (domainname, msgid, LC_MESSAGES) +#endif /* Return a string describing the errno code in ERRNUM. */ char * -_strerror_internal (int errnum, - char *buf, - size_t buflen) +_strerror_internal (int errnum, char *buf, size_t buflen) { if (errnum < 0 || errnum >= _sys_nerr) { - static const char unk_orig[] = N_("Unknown error "); - const char *unk = _dl_starting_up ? unk_orig : _(unk_orig); + const char *unk = _("Unknown error "); const size_t unklen = strlen (unk); char *p = buf + buflen; *--p = '\0'; @@ -46,6 +49,5 @@ _strerror_internal (int errnum, return memcpy (p - unklen, unk, unklen); } - return (char *) (_dl_starting_up ? _sys_errlist[errnum] - : _(_sys_errlist[errnum])); + return (char *) _(_sys_errlist[errnum]); } diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h index def2d18..6b5cc68 100644 --- a/sysdeps/generic/sysdep.h +++ b/sysdeps/generic/sysdep.h @@ -35,3 +35,7 @@ Cambridge, MA 02139, USA. */ #endif #endif + +/* Mark the end of function named SYM. This is used on some platforms + to generate correct debugging information. */ +#define END(sym) diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S index fd02205..cb33a89 100644 --- a/sysdeps/i386/__longjmp.S +++ b/sysdeps/i386/__longjmp.S @@ -33,4 +33,4 @@ ENTRY (__longjmp) /* Jump to saved PC. */ movl (JB_PC*4)(%ecx), %ecx jmp *%ecx -PSEUDO_END (__longjmp) +END (__longjmp) diff --git a/sysdeps/i386/bsd-_setjmp.S b/sysdeps/i386/bsd-_setjmp.S index b08a74f..a7ee5db 100644 --- a/sysdeps/i386/bsd-_setjmp.S +++ b/sysdeps/i386/bsd-_setjmp.S @@ -30,4 +30,4 @@ ENTRY (_setjmp) pushl %ecx /* Push back first argument. */ pushl %eax /* Push back return PC. */ jmp JUMPTARGET (C_SYMBOL_NAME (__sigsetjmp)) -PSEUDO_END (_setjmp) +END (_setjmp) diff --git a/sysdeps/i386/bsd-setjmp.S b/sysdeps/i386/bsd-setjmp.S index 5c8dd67..239a8c4 100644 --- a/sysdeps/i386/bsd-setjmp.S +++ b/sysdeps/i386/bsd-setjmp.S @@ -30,4 +30,4 @@ ENTRY (setjmp) pushl %ecx /* Push back first argument. */ pushl %eax /* Push back return PC. */ jmp JUMPTARGET (C_SYMBOL_NAME (__sigsetjmp)) -PSEUDO_END (setjmp) +END (setjmp) diff --git a/sysdeps/i386/i486/strcat.S b/sysdeps/i386/i486/strcat.S index e82b1c4..f705f42 100644 --- a/sysdeps/i386/i486/strcat.S +++ b/sysdeps/i386/i486/strcat.S @@ -258,4 +258,4 @@ L8: movl 8(%esp), %eax /* start address of destination is result */ popl %edi /* restore saved register */ ret -PSEUDO_END (strcat) +END (strcat) diff --git a/sysdeps/i386/i486/strlen.S b/sysdeps/i386/i486/strlen.S index 1a7ab7a..a92067a 100644 --- a/sysdeps/i386/i486/strlen.S +++ b/sysdeps/i386/i486/strlen.S @@ -130,4 +130,4 @@ L3: testb %cl, %cl /* is first byte NUL? */ L2: subl 4(%esp), %eax /* compute difference to string start */ ret -PSEUDO_END (strlen) +END (strlen) diff --git a/sysdeps/i386/i586/memset.S b/sysdeps/i386/i586/memset.S index 0dabad2..1e8a9c2 100644 --- a/sysdeps/i386/i586/memset.S +++ b/sysdeps/i386/i586/memset.S @@ -99,4 +99,4 @@ L2: shrl $2, %ecx /* convert byte count to longword count */ popl %edi ret -PSEUDO_END (memset) +END (memset) diff --git a/sysdeps/i386/i586/strchr.S b/sysdeps/i386/i586/strchr.S index 8a6691f..1477350 100644 --- a/sysdeps/i386/i586/strchr.S +++ b/sysdeps/i386/i586/strchr.S @@ -326,7 +326,7 @@ L3: xorl %eax, %eax /* set return value = NULL */ popl %edi ret -PSEUDO_END (strchr) +END (strchr) #undef index weak_alias (strchr, index) diff --git a/sysdeps/i386/i586/strlen.S b/sysdeps/i386/i586/strlen.S index cce750c..ba24981 100644 --- a/sysdeps/i386/i586/strlen.S +++ b/sysdeps/i386/i586/strlen.S @@ -180,4 +180,4 @@ L2: subl 4(%esp), %eax /* now compute the length as difference character */ ret -PSEUDO_END (strlen) +END (strlen) diff --git a/sysdeps/i386/memchr.S b/sysdeps/i386/memchr.S index 7d2779b..fcf873e 100644 --- a/sysdeps/i386/memchr.S +++ b/sysdeps/i386/memchr.S @@ -313,4 +313,4 @@ L9: popl %edi /* pop saved registers */ popl %esi ret -PSEUDO_END (memchr) +END (memchr) diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S index 4bf9b23..73714b7 100644 --- a/sysdeps/i386/memcmp.S +++ b/sysdeps/i386/memcmp.S @@ -63,7 +63,7 @@ L1: popl %esi /* Restore registers. */ movl %edx, %edi ret -PSEUDO_END (memcmp) +END (memcmp) #undef bcmp weak_alias (memcmp, bcmp) diff --git a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S index e877ae3..23e2b74 100644 --- a/sysdeps/i386/setjmp.S +++ b/sysdeps/i386/setjmp.S @@ -53,4 +53,4 @@ here: popl %ecx #else jmp __sigjmp_save #endif -PSEUDO_END (__sigsetjmp) +END (__sigsetjmp) diff --git a/sysdeps/i386/stpcpy.S b/sysdeps/i386/stpcpy.S index 46f64b5..9df0e33 100644 --- a/sysdeps/i386/stpcpy.S +++ b/sysdeps/i386/stpcpy.S @@ -83,6 +83,6 @@ L4: incl %eax L3: incl %eax L2: ret -PSEUDO_END (__stpcpy) +END (__stpcpy) weak_alias (__stpcpy, stpcpy) diff --git a/sysdeps/i386/stpncpy.S b/sysdeps/i386/stpncpy.S index 7590e57..b76f617 100644 --- a/sysdeps/i386/stpncpy.S +++ b/sysdeps/i386/stpncpy.S @@ -139,6 +139,6 @@ L3: decl %ecx /* all bytes written? */ L9: popl %esi /* restore saved register content */ ret -PSEUDO_END (__stpncpy) +END (__stpncpy) weak_alias (__stpncpy, stpncpy) diff --git a/sysdeps/i386/strchr.S b/sysdeps/i386/strchr.S index 50c3d7b..1c91c40 100644 --- a/sysdeps/i386/strchr.S +++ b/sysdeps/i386/strchr.S @@ -274,6 +274,6 @@ L7: testb %cl, %cl /* is first byte C? */ L6: popl %edi /* restore saved register content */ ret -PSEUDO_END (strchr) +END (strchr) weak_alias (strchr, index) diff --git a/sysdeps/i386/strcspn.S b/sysdeps/i386/strcspn.S index 1e80225..387d4ae 100644 --- a/sysdeps/i386/strcspn.S +++ b/sysdeps/i386/strcspn.S @@ -174,4 +174,4 @@ L4: subl %edx, %eax /* we have to return the number of valid addl $256, %esp /* remove stopset */ ret -PSEUDO_END (strcspn) +END (strcspn) diff --git a/sysdeps/i386/strlen.c b/sysdeps/i386/strlen.c index 3c1398b..6305d36 100644 --- a/sysdeps/i386/strlen.c +++ b/sysdeps/i386/strlen.c @@ -1,6 +1,6 @@ /* strlen -- determine the length of a string. For Intel 80x86, x>=3. - Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc. Contributed by Torbjorn Granlund (tege@sics.se). The GNU C Library is free software; you can redistribute it and/or @@ -18,11 +18,10 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <string.h> size_t -DEFUN(strlen, (str), CONST char *str) +strlen (const char *str) { int cnt; diff --git a/sysdeps/i386/strpbrk.S b/sysdeps/i386/strpbrk.S index 41769b0..5d0dfec 100644 --- a/sysdeps/i386/strpbrk.S +++ b/sysdeps/i386/strpbrk.S @@ -175,4 +175,4 @@ L4: addl $256, %esp /* remove stopset */ xorl %eax, %eax /* return NULL */ L7: ret -PSEUDO_END (strpbrk) +END (strpbrk) diff --git a/sysdeps/i386/strrchr.S b/sysdeps/i386/strrchr.S index 8cad7e5..f47bf94 100644 --- a/sysdeps/i386/strrchr.S +++ b/sysdeps/i386/strrchr.S @@ -321,6 +321,6 @@ L2: popl %esi /* restore saved register content */ popl %edi ret -PSEUDO_END (strrchr) +END (strrchr) weak_alias (strrchr, rindex) diff --git a/sysdeps/i386/strspn.S b/sysdeps/i386/strspn.S index fbba811c..508aa7f 100644 --- a/sysdeps/i386/strspn.S +++ b/sysdeps/i386/strspn.S @@ -174,4 +174,4 @@ L4: subl %edx, %eax /* we have to return the number of valid addl $256, %esp /* remove stopset */ ret -PSEUDO_END (strspn) +END (strspn) diff --git a/sysdeps/i386/strtok.S b/sysdeps/i386/strtok.S index a510e18..19f62cf 100644 --- a/sysdeps/i386/strtok.S +++ b/sysdeps/i386/strtok.S @@ -282,4 +282,4 @@ LreturnNULL: # endif #endif ret -PSEUDO_END (FUNCTION) +END (FUNCTION) diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h index 9d21342..a11aa72 100644 --- a/sysdeps/i386/sysdep.h +++ b/sysdeps/i386/sysdep.h @@ -52,6 +52,10 @@ Cambridge, MA 02139, USA. */ C_LABEL(name) \ CALL_MCOUNT +#undef END +#define END(name) \ + ASM_SIZE_DIRECTIVE(name) + /* If compiled for profiling, call `mcount' at the start of each function. */ #ifdef PROF /* The mcount code relies on a normal frame pointer being on the stack @@ -80,7 +84,7 @@ lose: SYSCALL_PIC_SETUP \ #undef PSEUDO_END #define PSEUDO_END(name) \ - ASM_SIZE_DIRECTIVE(name) + END (name) #ifdef PIC #define JUMPTARGET(name) name##@PLT diff --git a/sysdeps/m68k/bsd-_setjmp.S b/sysdeps/m68k/bsd-_setjmp.S index 32d25e4..dc1f52c 100644 --- a/sysdeps/m68k/bsd-_setjmp.S +++ b/sysdeps/m68k/bsd-_setjmp.S @@ -46,4 +46,4 @@ ENTRY (_setjmp) #else jmp C_SYMBOL_NAME (__sigsetjmp) #endif -PSEUDO_END (_setjmp) +END (_setjmp) diff --git a/sysdeps/m68k/bsd-setjmp.S b/sysdeps/m68k/bsd-setjmp.S index a4053bd..7158907 100644 --- a/sysdeps/m68k/bsd-setjmp.S +++ b/sysdeps/m68k/bsd-setjmp.S @@ -44,4 +44,4 @@ ENTRY (setjmp) #else jmp C_SYMBOL_NAME (__sigsetjmp) #endif -PSEUDO_END (setjmp) +END (setjmp) diff --git a/sysdeps/mach/_strerror.c b/sysdeps/mach/_strerror.c index 8b32f05..eae43bd 100644 --- a/sysdeps/mach/_strerror.c +++ b/sysdeps/mach/_strerror.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,15 @@ Cambridge, MA 02139, USA. */ #include <errorlib.h> #include "../stdio-common/_itoa.h" +/* It is critical here that we always use the `dcgettext' function for + the message translation. Since <libintl.h> only defines the macro + `dgettext' to use `dcgettext' for optimizing programs this is not + always guaranteed. */ +#ifndef dgettext +# include <locale.h> /* We need LC_MESSAGES. */ +# define dgettext(domainname, msgid) dcgettext (domainname, msgid, LC_MESSAGES) +#endif + /* Return a string describing the errno code in ERRNUM. */ char * _strerror_internal (int errnum, char *buf, size_t buflen) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 823335d..32b050e 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -50,7 +50,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <netinet6/in6.h> #endif /* INET6 */ #include <netdb.h> - +#include <arpa/inet.h> +#include <string.h> #define GAIH_OKIFUNSPEC 0x0100 #define GAIH_EAI ~(GAIH_OKIFUNSPEC) @@ -90,7 +91,7 @@ static struct gaih_addrtuple nulladdr; struct gaih_typeproto { int socktype; int protocol; - char *name; + const char *name; }; static struct gaih_typeproto gaih_inet_typeproto[] = { @@ -121,7 +122,6 @@ static int gaih_inet_serv(char *servicename, struct gaih_typeproto *tp, struct g static int gaih_inet(const char *name, const struct gaih_service *service, const struct addrinfo *req, struct addrinfo **pai) { - struct hostent *h = NULL; struct gaih_typeproto *tp = gaih_inet_typeproto; struct gaih_servtuple *st = &nullserv; struct gaih_addrtuple *at = &nulladdr; @@ -412,7 +412,8 @@ static struct gaih gaih[] = { int getaddrinfo(const char *name, const char *service, const struct addrinfo *req, struct addrinfo **pai) { - int i, j = 0; + int i = 0; + int j = 0; struct addrinfo *p = NULL, **end = &p; struct gaih *g = gaih, *pg = NULL; struct gaih_service gaih_service, *pservice; @@ -446,7 +447,7 @@ int getaddrinfo(const char *name, const char *service, j++; if (!((pg && (pg->gaih == g->gaih)))) { pg = g; - if (i = g->gaih(name, pservice, req, end)) { + if ((i = g->gaih(name, pservice, req, end))) { if (!req->ai_family && (i & GAIH_OKIFUNSPEC)) continue; goto gaih_err; diff --git a/sysdeps/unix/i386/sysdep.S b/sysdeps/unix/i386/sysdep.S index 7dced7c..9bf9fee 100644 --- a/sysdeps/unix/i386/sysdep.S +++ b/sysdeps/unix/i386/sysdep.S @@ -68,8 +68,5 @@ notb: movl $-1, %eax ret -#ifdef __ELF__ #undef __syscall_error -.Lfe2: - .size __syscall_error, .Lfe2-__syscall_error -#endif +END (__syscall_error) diff --git a/sysdeps/unix/sysv/i386/time.S b/sysdeps/unix/sysv/i386/time.S index f492141..e3794d6 100644 --- a/sysdeps/unix/sysv/i386/time.S +++ b/sysdeps/unix/sysv/i386/time.S @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,3 +24,4 @@ SYSCALL (time, 1) je null movl %eax, (%edx) /* Yes; store the time there. */ null: ret +PSEUDO_END (time) diff --git a/sysdeps/unix/sysv/linux/i386/clone.S b/sysdeps/unix/sysv/linux/i386/clone.S index d213b80..7e02f76 100644 --- a/sysdeps/unix/sysv/linux/i386/clone.S +++ b/sysdeps/unix/sysv/linux/i386/clone.S @@ -66,9 +66,6 @@ ENTRY(__clone) jz thread_start ret -PSEUDO_END (__clone) - - SYSCALL_ERROR_HANDLER thread_start: subl %ebp,%ebp /* terminate the stack frame */ @@ -76,4 +73,6 @@ thread_start: pushl %eax call JUMPTARGET (_exit) -weak_alias(__clone, clone) +PSEUDO_END (__clone) + +weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/i386/mmap.S b/sysdeps/unix/sysv/linux/i386/mmap.S index 30b0f76..16029d1 100644 --- a/sysdeps/unix/sysv/linux/i386/mmap.S +++ b/sysdeps/unix/sysv/linux/i386/mmap.S @@ -19,7 +19,6 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> .text - SYSCALL_ERROR_HANDLER ENTRY (__mmap) @@ -42,6 +41,7 @@ ENTRY (__mmap) /* Successful; return the syscall's value. */ ret - .size __mmap,.-__mmap + +PSEUDO_END (__mmap) weak_alias (__mmap, mmap) diff --git a/sysdeps/unix/sysv/linux/i386/socket.S b/sysdeps/unix/sysv/linux/i386/socket.S index 0cf4bfd..78e8b03 100644 --- a/sysdeps/unix/sysv/linux/i386/socket.S +++ b/sysdeps/unix/sysv/linux/i386/socket.S @@ -23,8 +23,6 @@ Cambridge, MA 02139, USA. */ #define P2(a, b) a##b .text - SYSCALL_ERROR_HANDLER - /* The socket-oriented system calls are handled unusally in Linux. They are all gated through the single `socketcall' system call number. `socketcall' takes two arguments: the first is the subcode, specifying @@ -52,11 +50,12 @@ ENTRY (P(__,socket)) movl %edx, %ebx /* %eax is < 0 if there was an error. */ - testl %eax, %eax - jl syscall_error + cmpl $-125, %eax + jae syscall_error /* Successful; return the syscall's value. */ ret - .size P(__,socket),.-P(__,socket) + +PSEUDO_END (P(__,socket)) weak_alias (P(__,socket), socket) diff --git a/sysdeps/unix/sysv/linux/i386/syscall.S b/sysdeps/unix/sysv/linux/i386/syscall.S index e7839cd..018a86e 100644 --- a/sysdeps/unix/sysv/linux/i386/syscall.S +++ b/sysdeps/unix/sysv/linux/i386/syscall.S @@ -22,8 +22,8 @@ Cambridge, MA 02139, USA. */ more information about the value -125 used below.*/ .text - SYSCALL_ERROR_HANDLER /* Define error handler for PIC. */ ENTRY (syscall) + PUSHARGS_5 /* Save register contents. */ _DOARGS_5(36) /* Load arguments. */ movl 16(%esp), %eax /* Load syscall number into %eax. */ @@ -32,4 +32,5 @@ ENTRY (syscall) cmpl $-125, %eax /* Check %eax for error. */ jae syscall_error /* Jump to error handler if error. */ ret /* Return to caller. */ - .size syscall,.-syscall + +PSEUDO_END (syscall) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.S b/sysdeps/unix/sysv/linux/i386/sysdep.S index 9727f89..742ba2b 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.S +++ b/sysdeps/unix/sysv/linux/i386/sysdep.S @@ -67,4 +67,4 @@ ENTRY (__errno_location) movl $errno, %eax #endif ret - .size __errno_location, .-__errno_location +END (__errno_location) diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index b00c976..5d378fd 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -28,11 +28,7 @@ Cambridge, MA 02139, USA. */ of the kernel. But these symbols do not follow the SYS_* syntax so we have to redefine the `SYS_ify' macro here. */ #undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif +#define SYS_ify(syscall_name) __NR_##syscall_name #ifdef ASSEMBLER @@ -51,19 +47,22 @@ Cambridge, MA 02139, USA. */ #undef PSEUDO #define PSEUDO(name, syscall_name, args) \ .text; \ - SYSCALL_ERROR_HANDLER \ ENTRY (name) \ DO_CALL (args, syscall_name); \ cmpl $-125, %eax; \ jae syscall_error; +#undef PSEUDO_END +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER \ + END (name) + #ifndef PIC #define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ #else /* Store (- %eax) into errno through the GOT. */ #ifdef _LIBC_REENTRANT #define SYSCALL_ERROR_HANDLER \ - .type syscall_error,@function; \ syscall_error: \ pushl %ebx; \ call 0f; \ @@ -79,13 +78,11 @@ syscall_error: \ popl %ebx; \ movl %ecx, (%eax); \ movl $-1, %eax; \ - ret; \ - .size syscall_error,.-syscall-error; + ret; /* A quick note: it is assumed that the call to `__errno_location' does not modify the stack! */ #else #define SYSCALL_ERROR_HANDLER \ - .type syscall_error,@function; \ syscall_error: \ call 0f; \ 0:popl %ecx; \ @@ -95,8 +92,7 @@ syscall_error: \ movl errno@GOT(%ecx), %ecx; \ movl %edx, (%ecx); \ movl $-1, %eax; \ - ret; \ - .size syscall_error,.-syscall-error; + ret; #endif /* _LIBC_REENTRANT */ #endif /* PIC */ @@ -121,7 +117,7 @@ syscall_error: \ (Of course a function with say 3 arguments does not have entries for arguments 4 and 5.) - The following code tries hard to be optimal. A general assuption + The following code tries hard to be optimal. A general assumption (which is true according to the data books I have) is that 2 * xchg is more expensive than pushl + movl + popl @@ -136,7 +132,7 @@ syscall_error: \ (2 * movl is less expensive than pushl + popl). Second unlike for the other registers we don't save the content of - %ecx and %edx when we have than 1 and 2 registers resp. + %ecx and %edx when we have more than 1 and 2 registers resp. The code below might look a bit long but we have to take care for the pipelined processors (i586 and up). Here the `pushl' and `popl' diff --git a/sysdeps/unix/sysv/linux/m68k/clone.S b/sysdeps/unix/sysv/linux/m68k/clone.S index 4dcd90e..4465dd8 100644 --- a/sysdeps/unix/sysv/linux/m68k/clone.S +++ b/sysdeps/unix/sysv/linux/m68k/clone.S @@ -27,7 +27,6 @@ Cambridge, MA 02139, USA. */ .text ENTRY (__clone) - CALL_MCOUNT /* Sanity check arguments. */ movel #-EINVAL, %d0 @@ -63,17 +62,12 @@ ENTRY (__clone) rts - SYSCALL_ERROR_HANDLER - thread_start: subl %fp, %fp /* terminate the stack frame */ jsr (%a0) movel %d0, -(%sp) -#ifdef PIC - bsrl _exit@PLTPC -#else - jbsr _exit -#endif + jbsr JUMPTARGET (_exit) + PSEUDO_END (__clone) weak_alias (__clone, clone) diff --git a/sysdeps/unix/sysv/linux/m68k/mmap.S b/sysdeps/unix/sysv/linux/m68k/mmap.S index 9bac533..257ff4d 100644 --- a/sysdeps/unix/sysv/linux/m68k/mmap.S +++ b/sysdeps/unix/sysv/linux/m68k/mmap.S @@ -19,10 +19,7 @@ Cambridge, MA 02139, USA. */ #include <sysdep.h> .text - SYSCALL_ERROR_HANDLER - ENTRY (__mmap) - CALL_MCOUNT move.l #SYS_ify (mmap), %d0 /* System call number in %d0. */ diff --git a/sysdeps/unix/sysv/linux/m68k/sigreturn.S b/sysdeps/unix/sysv/linux/m68k/sigreturn.S index 04f0db5..0971acd 100644 --- a/sysdeps/unix/sysv/linux/m68k/sigreturn.S +++ b/sysdeps/unix/sysv/linux/m68k/sigreturn.S @@ -20,12 +20,10 @@ Cambridge, MA 02139, USA. */ .text ENTRY (__sigreturn) - CALL_MCOUNT - addq.l #4, %sp /* Pop the return PC. */ DO_CALL (#SYS_ify (sigreturn), 0) /* Do the system call; it never returns. */ /* NOTREACHED */ -PSEUDO_END (__sigreturn) +END (__sigreturn) weak_alias (__sigreturn, sigreturn) diff --git a/sysdeps/unix/sysv/linux/m68k/socket.S b/sysdeps/unix/sysv/linux/m68k/socket.S index 1294287..d0741af 100644 --- a/sysdeps/unix/sysv/linux/m68k/socket.S +++ b/sysdeps/unix/sysv/linux/m68k/socket.S @@ -23,8 +23,6 @@ Cambridge, MA 02139, USA. */ #define P2(a, b) a##b .text - SYSCALL_ERROR_HANDLER - /* The socket-oriented system calls are handled unusally in Linux. They are all gated through the single `socketcall' system call number. `socketcall' takes two arguments: the first is the subcode, specifying @@ -35,7 +33,6 @@ Cambridge, MA 02139, USA. */ .globl P(__,socket) ENTRY (P(__,socket)) - CALL_MCOUNT /* Save registers. */ move.l %d2, %a0 diff --git a/sysdeps/unix/sysv/linux/m68k/syscall.S b/sysdeps/unix/sysv/linux/m68k/syscall.S index 1c7bd6b..b7417aa 100644 --- a/sysdeps/unix/sysv/linux/m68k/syscall.S +++ b/sysdeps/unix/sysv/linux/m68k/syscall.S @@ -22,10 +22,7 @@ Cambridge, MA 02139, USA. */ more information about the value -128 used below.*/ .text - SYSCALL_ERROR_HANDLER ENTRY (syscall) - CALL_MCOUNT - move.l 4(%sp), %d0 /* Load syscall number. */ _DOARGS_5 (24) /* Frob arguments. */ trap &0 /* Do the system call. */ diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.S b/sysdeps/unix/sysv/linux/m68k/sysdep.S index 31fa20f..848ece5 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.S +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.S @@ -46,7 +46,10 @@ __errno = errno /* This name is expected by the MT code. */ /* The syscall stubs jump here when they detect an error. */ -ENTRY (__syscall_error) + .globl __syscall_error + .type __syscall_error, @function + .align 4 +__syscall_error: neg.l %d0 move.l %d0, errno #ifdef _LIBC_REENTRANT @@ -59,15 +62,14 @@ ENTRY (__syscall_error) return a pointer. */ move.l %d0, %a0 rts -PSEUDO_END (__syscall_error) +END (__syscall_error) #endif /* PIC */ ENTRY (__errno_location) - CALL_MCOUNT #ifdef PIC move.l (%pc, errno@GOTPC), %a0 #else lea errno, %a0 #endif rts -PSEUDO_END (__errno_location) +END (__errno_location) diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index 9cddd20..3366caa 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -41,6 +41,9 @@ Cambridge, MA 02139, USA. */ C_LABEL(name) \ CALL_MCOUNT +#undef END +#define END(name) .size name, . - name + /* If compiled for profiling, call `_mcount' at the start of each function. */ #ifdef PROF /* The mcount code relies on a normal frame pointer being on the stack @@ -76,7 +79,6 @@ Cambridge, MA 02139, USA. */ error values. */ #define PSEUDO(name, syscall_name, args) \ .text; \ - SYSCALL_ERROR_HANDLER \ ENTRY (name) \ DO_CALL (&SYS_ify (syscall_name), args); \ moveq.l &-128, %d1; \ @@ -84,13 +86,14 @@ Cambridge, MA 02139, USA. */ jcc syscall_error #undef PSEUDO_END -#define PSEUDO_END(name) .size name, . - name +#define PSEUDO_END(name) \ + SYSCALL_ERROR_HANDLER; \ + END (name) #ifdef PIC /* Store (- %d0) into errno through the GOT. */ #ifdef _LIBC_REENTRANT #define SYSCALL_ERROR_HANDLER \ - .type syscall_error, @function; \ syscall_error: \ move.l (errno@GOTPC, %pc), %a0; \ neg.l %d0; \ @@ -105,7 +108,6 @@ syscall_error: \ rts; #else #define SYSCALL_ERROR_HANDLER \ - .type syscall_error, @function; \ syscall_error: \ move.l (errno@GOTPC, %pc), %a0; \ neg.l %d0; \ diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index d616560..129951a 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -13,7 +13,7 @@ geteuid - geteuid 0 __geteuid geteuid getpgid - getpgid 1 __getpgid getpgid getpgrp - getpgrp 0 getpgrp getppid - getppid 0 __getppid getppid -getresuid - getresuid 3 getresuid +getresuid EXTRA getresuid 3 getresuid getsid - getsid 1 getsid init_module EXTRA init_module 5 init_module ioperm - ioperm 3 ioperm @@ -35,22 +35,22 @@ s_getpriority getpriority getpriority 2 __syscall_getpriority s_ptrace ptrace ptrace 4 __syscall_ptrace s_reboot EXTRA reboot 3 __syscall_reboot s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend -sched_setp - sched_setparam 2 __sched_setparam sched_setparam +s_sysctl sysctl _sysctl 1 __syscall__sysctl sched_getp - sched_getparam 2 __sched_getparam sched_getparam -sched_sets - sched_setscheduler 3 __sched_setscheduler sched_setscheduler sched_gets - sched_getscheduler 1 __sched_getscheduler sched_getscheduler -sched_yield - sched_yield 0 __sched_yield sched_yield sched_primax - sched_get_priority_max 1 __sched_get_priority_max sched_get_priority_max sched_primin - sched_get_priority_min 1 __sched_get_priority_min sched_get_priority_min sched_rr_gi - sched_rr_get_interval 2 __sched_rr_get_interval sched_rr_get_interval +sched_setp - sched_setparam 2 __sched_setparam sched_setparam +sched_sets - sched_setscheduler 3 __sched_setscheduler sched_setscheduler +sched_yield - sched_yield 0 __sched_yield sched_yield select - _newselect 5 __select select setfsgid EXTRA setfsgid 1 setfsgid setfsuid EXTRA setfsuid 1 setfsuid setpgid - setpgid 2 __setpgid setpgid -setresuid - setresuid 3 setresuid +setresuid EXTRA setresuid 3 setresuid sigpending - sigpending 1 sigpending sigprocmask - sigprocmask 3 __sigprocmask sigprocmask -s_sysctl sysctl _sysctl 1 __syscall__sysctl sysinfo EXTRA sysinfo 1 sysinfo swapon - swapon 2 swapon umount EXTRA umount 1 __umount umount |