diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2003-08-17 00:37:19 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2003-08-17 00:37:19 +0000 |
| commit | 137ffcdc6effa6b3a750b1d0c228dae61b96adbc (patch) | |
| tree | fcccdc24bd598da4d8c6dcf8ceb34abf4d7b6da0 | |
| parent | 36a8cf1e48eda7d925454c3882dfc34ff0b887f3 (diff) | |
| download | glibc-137ffcdc6effa6b3a750b1d0c228dae61b96adbc.tar.xz glibc-137ffcdc6effa6b3a750b1d0c228dae61b96adbc.zip | |
Update.
2003-08-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL, PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL,
ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL):
Define.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL,
PSEUDO_END_ERRVAL, ret_ERRVAL): Define.
* sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define.
* sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64,
posix_fadvise64_64): Remove.
* sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add
V flag.
* sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
(posix_fadvise64): Likewise.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64):
Likewise.
* sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to...
* sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here.
(__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation.
(__posix_fadvise64_l32): New function.
* sysdeps/unix/sysv/linux/i386/Makefile: Revert last change.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export
posix_fadvise64@@GLIBC_2.3.3.
* sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise.
* sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return
error value.
* sysdeps/unix/sysv/linux/posix_fadvise64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h
(SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD.
2003-08-15 Jakub Jelinek <jakub@redhat.com>
* sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove.
(elf_machine_matches_host): Remove weak extern stuff.
Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED.
(elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern
stuff. Use GL(dl_hwcap) unconditionally.
26 files changed, 336 insertions, 45 deletions
@@ -1,3 +1,63 @@ +2003-08-16 Jakub Jelinek <jakub@redhat.com> + + * sysdeps/powerpc/powerpc32/sysdep.h (PSEUDO_ERRVAL, + PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define. + * sysdeps/powerpc/powerpc64/sysdep.h (PSEUDO_ERRVAL, + PSEUDO_RET_ERRVAL, ret_ERRVAL, PSEUDO_END_ERRVAL): Define. + * sysdeps/unix/alpha/sysdep.h (PSEUDO_ERRVAL, + ret_ERRVAL, PSEUDO_END_ERRVAL): Define. + * sysdeps/unix/mips/sysdep.h (PSEUDO_ERRVAL, + ret_ERRVAL, PSEUDO_END_ERRVAL): Define. + * sysdeps/unix/sparc/sysdep.h (PSEUDO_ERRVAL, + ret_ERRVAL): Define. + * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (PSEUDO_ERRVAL, + PSEUDO_END_ERRVAL, ret_ERRVAL): Define. + * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h (PSEUDO_ERRVAL, + PSEUDO_END_ERRVAL, ret_ERRVAL): Define. + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO_ERRVAL): + Define. + * sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h (PSEUDO_ERRVAL, + PSEUDO_END_ERRVAL, ret_ERRVAL): Define. + * sysdeps/unix/sysdep.h (PSEUDO_END_ERRVAL): Define. + + * sysdeps/unix/sysv/linux/syscalls.list (posix_fadvise64, + posix_fadvise64_64): Remove. + * sysdeps/unix/sysv/linux/alpha/syscalls.list (posix_fadvise64): Add + V flag. + * sysdeps/unix/sysv/linux/ia64/syscalls.list (posix_fadvise64): + Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list + (posix_fadvise64): Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list + (posix_fadvise64): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list + (posix_fadvise64): Likewise. + * sysdeps/unix/sysv/linux/x86_64/syscalls.list (posix_fadvise64): + Likewise. + * sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S: Moved to... + * sysdeps/unix/sysv/linux/i386/posix_fadvise64.S: ...here. + (__posix_fadvise64_l64): Fix a typo in fadvise64 syscall invocation. + (__posix_fadvise64_l32): New function. + * sysdeps/unix/sysv/linux/i386/Makefile: Revert last change. + * sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions (libc): Export + posix_fadvise64@@GLIBC_2.3.3. + * sysdeps/unix/sysv/linux/s390/s390-32/Versions (libc): Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/Versions (libc): Likewise. + * sysdeps/unix/sysv/linux/posix_fadvise.c (posix_fadvise): Return + error value. + * sysdeps/unix/sysv/linux/posix_fadvise64.c: New file. + + * sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h + (SYSCALL_ERROR_HANDLER): Use TLS errno/__libc_errno if USE___THREAD. + +2003-08-15 Jakub Jelinek <jakub@redhat.com> + + * sysdeps/sparc/sparc32/dl-machine.h (WEAKADDR): Remove. + (elf_machine_matches_host): Remove weak extern stuff. + Use GL(dl_hwcap) unconditionally and GL(dl_hwcap_mask) if SHARED. + (elf_machine_runtime_setup, sparc_fixup_plt): Remove weak extern + stuff. Use GL(dl_hwcap) unconditionally. + 2003-08-16 Alan Modra <amodra@bigpond.net.au> * sysdeps/powerpc/powerpc64/elf/start.S: Add a nop after diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h index 338c69ae68..43179d14f0 100644 --- a/sysdeps/powerpc/powerpc32/sysdep.h +++ b/sysdeps/powerpc/powerpc32/sysdep.h @@ -144,6 +144,19 @@ #define PSEUDO_END_NOERRNO(name) \ END (name) +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .section ".text"; \ + ENTRY (name) \ + DO_CALL (SYS_ify (syscall_name)); + +#define PSEUDO_RET_ERRVAL \ + blr +#define ret_ERRVAL PSEUDO_RET_ERRVAL + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) \ + END (name) + /* Local labels stripped out by the linker. */ #undef L #define L(x) .L##x diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h index 203484c896..6fbe342a2a 100644 --- a/sysdeps/powerpc/powerpc64/sysdep.h +++ b/sysdeps/powerpc/powerpc64/sysdep.h @@ -249,6 +249,20 @@ LT_LABELSUFFIX(name,_name_end): ; \ #define PSEUDO_END_NOERRNO(name) \ END (name) +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .section ".text"; \ + ENTRY (name) \ + DO_CALL (SYS_ify (syscall_name)); + +#define PSEUDO_RET_ERRVAL \ + blr + +#define ret_ERRVAL PSEUDO_RET_ERRVAL + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(name) \ + END (name) + /* Label in text section. */ /* ppc64 function descriptors which requires . notation */ #define C_TEXT(name) .##name diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h index 45bb0bf152..f43b4788ef 100644 --- a/sysdeps/sparc/sparc32/dl-machine.h +++ b/sysdeps/sparc/sparc32/dl-machine.h @@ -40,12 +40,6 @@ #define OPCODE_SAVE_SP 0x9de3bfa8 /* save %sp, -(16+6)*4, %sp */ #define OPCODE_BA 0x30800000 /* b,a ?; add PC-rel word address */ -/* Protect some broken versions of gcc from misinterpreting weak addresses. */ -#define WEAKADDR(x) ({ __typeof(x) *_px = &x; \ - __asm ("" : "=r" (_px) : "0" (_px)); \ - _px; }) - - /* Use a different preload file when running in 32-bit emulation mode on a 64-bit host. */ #define LD_SO_PRELOAD ((GL(dl_hwcap) & HWCAP_SPARC_V9) \ @@ -61,16 +55,13 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr) return 1; else if (ehdr->e_machine == EM_SPARC32PLUS) { - unsigned long *hwcap; -#ifndef SHARED - weak_extern (_dl_hwcap); - weak_extern (_dl_hwcap_mask); -#endif - - hwcap = WEAKADDR (GL(dl_hwcap)); /* XXX The following is wrong! Dave Miller rejected to implement it correctly. If this causes problems shoot *him*! */ - return hwcap == NULL || (*hwcap & GL(dl_hwcap_mask) & HWCAP_SPARC_V9); +#ifdef SHARED + return GL(dl_hwcap) & GL(dl_hwcap_mask) & HWCAP_SPARC_V9; +#else + return GL(dl_hwcap) & HWCAP_SPARC_V9; +#endif } else return 0; @@ -170,17 +161,12 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) || __builtin_expect (l->l_info [VALIDX (DT_GNU_LIBLISTSZ)] != NULL, 0)) { /* Need to reinitialize .plt to undo prelinking. */ - unsigned long *hwcap; int do_flush; Elf32_Rela *rela = (Elf32_Rela *) D_PTR (l, l_info[DT_JMPREL]); Elf32_Rela *relaend = (Elf32_Rela *) ((char *) rela + l->l_info[DT_PLTRELSZ]->d_un.d_val); -#ifndef SHARED - weak_extern (_dl_hwcap); -#endif - hwcap = WEAKADDR (GL(dl_hwcap)); - do_flush = (!hwcap || (*hwcap & HWCAP_SPARC_FLUSH)); + do_flush = GL(dl_hwcap) & HWCAP_SPARC_FLUSH; /* prelink must ensure there are no R_SPARC_NONE relocs left in .rela.plt. */ @@ -367,13 +353,7 @@ sparc_fixup_plt (const Elf32_Rela *reloc, Elf32_Addr *reloc_addr, #ifndef RTLD_BOOTSTRAP /* Note that we don't mask the hwcap here, as the flush is essential to functionality on those cpu's that implement it. */ - unsigned long *hwcap; - int do_flush; -# ifndef SHARED - weak_extern (_dl_hwcap); -# endif - hwcap = WEAKADDR (GL(dl_hwcap)); - do_flush = (!hwcap || (*hwcap & HWCAP_SPARC_FLUSH)); + int do_flush = GL(dl_hwcap) & HWCAP_SPARC_FLUSH; #else /* Unfortunately, this is necessary, so that we can ensure ld.so will not execute corrupt PLT entry instructions. */ diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h index b9bc1c0a2a..f12edef7a7 100644 --- a/sysdeps/unix/alpha/sysdep.h +++ b/sysdeps/unix/alpha/sysdep.h @@ -134,6 +134,21 @@ __LABEL(name) \ #define ret_NOERRNO ret +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .globl name; \ + .align 4; \ + .ent name,0; \ +__LABEL(name) \ + PSEUDO_PROLOGUE; \ + PSEUDO_PREPARE_ARGS \ + lda v0, SYS_ify(syscall_name); \ + call_pal PAL_callsys; + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(sym) END(sym) + +#define ret_ERRVAL ret + #define r0 v0 #define r1 a4 diff --git a/sysdeps/unix/mips/sysdep.h b/sysdeps/unix/mips/sysdep.h index 13a3752dc8..dd2795edc4 100644 --- a/sysdeps/unix/mips/sysdep.h +++ b/sysdeps/unix/mips/sysdep.h @@ -51,6 +51,18 @@ #define ret_NOERRNO ret +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .align 2; \ + ENTRY(name) \ + .set noreorder; \ + li v0, SYS_ify(syscall_name); \ + syscall + +#undef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(sym) .end sym; .size sym,.-sym + +#define ret_ERRVAL ret + #define r0 v0 #define r1 v1 /* The mips move insn is d,s. */ diff --git a/sysdeps/unix/sparc/sysdep.h b/sysdeps/unix/sparc/sysdep.h index 3f6a92a904..24225d9622 100644 --- a/sysdeps/unix/sparc/sysdep.h +++ b/sysdeps/unix/sparc/sysdep.h @@ -58,8 +58,15 @@ mov SYS_ify(syscall_name), %g1; \ ta 0 +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + .global syscall_error; \ + ENTRY (name) \ + mov SYS_ify(syscall_name), %g1; \ + ta 0 + #define ret retl; nop #define ret_NOERRNO retl; nop +#define ret_ERRVAL retl; nop #define r0 %o0 #define r1 %o1 #define MOVE(x,y) mov x, y diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h index 4619335d0a..11e5317dff 100644 --- a/sysdeps/unix/sysdep.h +++ b/sysdeps/unix/sysdep.h @@ -50,6 +50,9 @@ #ifndef PSEUDO_END_NOERRNO #define PSEUDO_END_NOERRNO(sym) PSEUDO_END(sym) #endif +#ifndef PSEUDO_END_ERRVAL +#define PSEUDO_END_ERRVAL(sym) PSEUDO_END(sym) +#endif /* Wrappers around system calls should normally inline the system call code. But sometimes it is not possible or implemented and we use this code. */ diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 60235d012f..d30a9b6b55 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -21,7 +21,7 @@ getpriority - getpriority i:ii __getpriority getpriority mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64 llseek EXTRA lseek C:3 __libc_lseek __lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64 lseek llseek - -posix_fadvise64 - fadvise64 4 posix_fadvise64 posix_fadvise +posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise64 posix_fadvise pread - pread64 C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64 pwrite - pwrite64 C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64 fstatfs - fstatfs i:ip __fstatfs fstatfs __fstatfs64 fstatfs64 diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile index 6aa5ce30ad..1ae69407ff 100644 --- a/sysdeps/unix/sysv/linux/i386/Makefile +++ b/sysdeps/unix/sysv/linux/i386/Makefile @@ -12,7 +12,3 @@ endif ifeq ($(subdir),resource) sysdep_routines += oldgetrlimit64 endif - -ifeq ($(subdir),io) -sysdep_routines += posix_fadvise64_64 -endif diff --git a/sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S index c1ee9b99dd..8d7219f12b 100644 --- a/sysdeps/unix/sysv/linux/i386/posix_fadvise64_64.S +++ b/sysdeps/unix/sysv/linux/i386/posix_fadvise64.S @@ -93,7 +93,7 @@ ENTRY (BP_SYM (__posix_fadvise64_l64)) movl LENLO(%esp), %esi movl FLAGS(%esp), %edi - movl $SYS_ify(fadvise64_64), %eax + movl $SYS_ify(fadvise64), %eax ENTER_KERNEL /* Restore registers. */ @@ -115,6 +115,18 @@ L(overflow): ret #endif -PSEUDO_END_NOERRNO (BP_SYM (__posix_fadvise64_l64)) +END (BP_SYM (__posix_fadvise64_l64)) + +#ifdef __NR_fadvise64 +PSEUDO_ERRVAL (__posix_fadvise64_l32, posix_fadvise64, 5) + ret +PSEUDO_END_ERRVAL (__posix_fadvise64_l32) +#else +ENTRY (BP_SYM (__posix_fadvise64_l32)) + movl $ENOSYS, %eax + ret +END (BP_SYM (__posix_fadvise64_l32)) +#endif default_symbol_version (__posix_fadvise64_l64, posix_fadvise64, GLIBC_2.3.3) +symbol_version (__posix_fadvise64_l32, posix_fadvise64, GLIBC_2.2) diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index c2027b670f..5d83df7a6e 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -5,7 +5,7 @@ umount2 - umount 2 __umount2 umount2 # Whee! 64-bit systems naturally implement llseek. llseek EXTRA lseek C:3 __libc_lseek __lseek lseek __libc_lseek64 __llseek llseek __lseek64 lseek64 lseek llseek - -posix_fadvise64 - fadvise64 4 posix_fadvise64 posix_fadvise +posix_fadvise64 - fadvise64 Vi:iiii posix_fadvise64 posix_fadvise pread - pread C:4 __libc_pread __libc_pread64 __pread pread __pread64 pread64 pwrite - pwrite C:4 __libc_pwrite __libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64 fstatfs - fstatfs i:ip __fstatfs fstatfs fstatfs64 __fstatfs64 diff --git a/sysdeps/unix/sysv/linux/posix_fadvise.c b/sysdeps/unix/sysv/linux/posix_fadvise.c index 808fc865ed..30a6d9e5be 100644 --- a/sysdeps/unix/sysv/linux/posix_fadvise.c +++ b/sysdeps/unix/sysv/linux/posix_fadvise.c @@ -27,10 +27,14 @@ int posix_fadvise (int fd, off_t offset, off_t len, int advise) { #ifdef __NR_fadvise64 - return INLINE_SYSCALL (fadvise64, 5, fd, - __LONG_LONG_PAIR (offset >> 31, offset), len, advise); + INTERNAL_SYSCALL_DECL (err); + int ret = INTERNAL_SYSCALL (fadvise64, err, 5, fd, + __LONG_LONG_PAIR (offset >> 31, offset), len, + advise); + if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + return INTERNAL_SYSCALL_ERRNO (ret, err); + return 0; #else - __set_errno (ENOSYS); - return -1; + return ENOSYS; #endif } diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c new file mode 100644 index 0000000000..89dfd8cdc3 --- /dev/null +++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c @@ -0,0 +1,78 @@ +/* Copyright (C) 2003 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 + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <errno.h> +#include <fcntl.h> +#include <sysdep.h> +#include <kernel-features.h> + +int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise); +int __posix_fadvise64_l32 (int fd, off64_t offset, size_t len, int advise); + +/* Advice the system about the expected behaviour of the application with + respect to the file associated with FD. */ + |
