diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-15 19:49:58 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2005-12-15 19:49:58 +0000 |
commit | f7c7c0e055425e0122996a91704cc12bfaeef308 (patch) | |
tree | 2c9723a6e45208c737d39c88b23b6103ab4292f6 /libc/sysdeps/linux | |
parent | 1ab4af32dbead92763566cc0cce9b0ff2d63598d (diff) | |
download | uClibc-alpine-f7c7c0e055425e0122996a91704cc12bfaeef308.tar.bz2 uClibc-alpine-f7c7c0e055425e0122996a91704cc12bfaeef308.tar.xz |
Hide fork and vfork, use the newly introduced *alias
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r-- | libc/sysdeps/linux/arm/vfork.S | 15 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/fork.c | 7 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/vfork.c | 7 | ||||
-rw-r--r-- | libc/sysdeps/linux/frv/vfork.S | 12 | ||||
-rw-r--r-- | libc/sysdeps/linux/i386/vfork.S | 9 | ||||
-rw-r--r-- | libc/sysdeps/linux/m68k/vfork.S | 15 | ||||
-rw-r--r-- | libc/sysdeps/linux/powerpc/vfork.S | 9 | ||||
-rw-r--r-- | libc/sysdeps/linux/powerpc/vfork.c | 4 | ||||
-rw-r--r-- | libc/sysdeps/linux/sh/vfork.S | 12 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/fork.S | 15 | ||||
-rw-r--r-- | libc/sysdeps/linux/sparc/vfork.S | 15 | ||||
-rw-r--r-- | libc/sysdeps/linux/x86_64/vfork.S | 11 |
12 files changed, 78 insertions, 53 deletions
diff --git a/libc/sysdeps/linux/arm/vfork.S b/libc/sysdeps/linux/arm/vfork.S index 530bba07c..68798995a 100644 --- a/libc/sysdeps/linux/arm/vfork.S +++ b/libc/sysdeps/linux/arm/vfork.S @@ -8,16 +8,20 @@ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ +#include <features.h> + #define _ERRNO_H #include <bits/errno.h> #include <sys/syscall.h> #ifdef __NR_fork .text -.global vfork -.type vfork,%function +.global __vfork +.hidden __vfork +.type __vfork,%function .align 4 -vfork: + +__vfork: #ifdef __NR_vfork swi __NR_vfork @@ -34,11 +38,12 @@ vfork: swi __NR_fork cmn r0, #4096 - /* Syscal worked. Return to child/parent */ + /* Syscall worked. Return to child/parent */ movcc pc, lr __error: b __syscall_error -.size vfork,.-vfork +.size __vfork,.-__vfork +strong_alias(__vfork,vfork) #endif diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c index e766799c0..899cbaf63 100644 --- a/libc/sysdeps/linux/common/fork.c +++ b/libc/sysdeps/linux/common/fork.c @@ -12,8 +12,9 @@ #ifdef __ARCH_HAS_MMU__ #ifdef __NR_fork -#define __NR___libc_fork __NR_fork -_syscall0(pid_t, __libc_fork); -weak_alias(__libc_fork, fork); +#define __NR___fork __NR_fork +attribute_hidden _syscall0(pid_t, __fork); +strong_alias(__fork,fork) +weak_alias(__fork,__libc_fork) #endif #endif diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c index ba4f042ca..d0a4d9a0e 100644 --- a/libc/sysdeps/linux/common/vfork.c +++ b/libc/sysdeps/linux/common/vfork.c @@ -2,7 +2,10 @@ #include <unistd.h> #include <sys/types.h> -pid_t vfork(void) +extern __pid_t __fork (void) __THROW attribute_hidden; + +pid_t attribute_hidden __vfork(void) { - return fork(); + return __fork(); } +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/frv/vfork.S b/libc/sysdeps/linux/frv/vfork.S index 230f2f820..b5ecc09af 100644 --- a/libc/sysdeps/linux/frv/vfork.S +++ b/libc/sysdeps/linux/frv/vfork.S @@ -17,15 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <features.h> + #include <asm/unistd.h> #define _ERRNO_H 1 #include <bits/errno.h> .text - .globl vfork - .type vfork,@function + .globl __vfork + .hidden __vfork + .type __vfork,@function /* int vfork(void) */ -vfork: +__vfork: setlos.p #__NR_vfork, gr7 setlos #-4096, gr4 tra gr0, gr0 @@ -38,5 +41,6 @@ vfork: ldd @(gr14, gr15), gr14 jmpl @(gr14, gr0) - .size vfork,.-vfork + .size __vfork,.-__vfork +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/i386/vfork.S b/libc/sysdeps/linux/i386/vfork.S index d382dbac3..18a8e5dfa 100644 --- a/libc/sysdeps/linux/i386/vfork.S +++ b/libc/sysdeps/linux/i386/vfork.S @@ -3,17 +3,20 @@ * */ +#include <features.h> #include <sys/syscall.h> #ifndef __NR_vfork /* No vfork so use fork instead */ -.weak vfork ; vfork = __libc_fork +hidden_strong_alias(__fork,__vfork) +weak_alias(vfork,__libc_fork) #else .text .global __vfork +.hidden __vfork .type __vfork,%function .align 1<<4 @@ -27,7 +30,5 @@ __vfork: ret .size __vfork,.-__vfork - - -.weak vfork ; vfork = __vfork #endif +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/m68k/vfork.S b/libc/sysdeps/linux/m68k/vfork.S index 5db163bf5..e58b9e949 100644 --- a/libc/sysdeps/linux/m68k/vfork.S +++ b/libc/sysdeps/linux/m68k/vfork.S @@ -1,3 +1,4 @@ +#include <features.h> #include <asm/unistd.h> @@ -10,11 +11,13 @@ .text .align 2 .globl errno - .globl vfork -#if defined __HAVE_ELF__ - .type vfork,@function + .globl __vfork +#ifdef __HAVE_ELF__ + .hidden __vfork + .type __vfork,@function #endif -vfork: + +__vfork: movl %sp@+, %a1 /* save the return address for later */ movl IMM __NR_vfork,%d0 trap #0 @@ -24,7 +27,7 @@ vfork: jmp %a1@ /* don't return, just jmp directly */ fix_errno: negl %d0 -#ifndef __PIC__ +#ifndef __PIC__ /* needs handling as the other archs */ movl errno, %a0 #else movl errno@GOT(%a5), %a0 @@ -33,3 +36,5 @@ fix_errno: movl IMM -1, %d0 jmp %a1@ /* don't return, just jmp directly */ +.size __vfork,.-__vfork +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/powerpc/vfork.S b/libc/sysdeps/linux/powerpc/vfork.S index 67d8aaeac..7cf5eaa16 100644 --- a/libc/sysdeps/linux/powerpc/vfork.S +++ b/libc/sysdeps/linux/powerpc/vfork.S @@ -1,14 +1,17 @@ +#include <features.h> #include <sys/syscall.h> #ifndef __NR_vfork /* No vfork so use fork instead */ -.weak vfork ; vfork = __libc_fork +hidden_strong_alias(__fork,__vfork) +weak_alias(vfork,__libc_fork) #else .text .global __vfork +.hidden __vfork .type __vfork,@function .type __syscall_error,@function @@ -17,7 +20,7 @@ __vfork: sc bnslr+ b __syscall_error -.size __vfork,.-__vfork -.weak vfork ; vfork = __vfork +.size __vfork,.-__vfork #endif +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/powerpc/vfork.c b/libc/sysdeps/linux/powerpc/vfork.c index 6623d8dde..39f992513 100644 --- a/libc/sysdeps/linux/powerpc/vfork.c +++ b/libc/sysdeps/linux/powerpc/vfork.c @@ -9,7 +9,7 @@ return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0), \ (type) __sc_ret -pid_t vfork(void) +pid_t attribute_hidden __vfork(void) { unsigned long __sc_ret, __sc_err; register unsigned long __sc_0 __asm__ ("r0"); @@ -46,4 +46,4 @@ pid_t vfork(void) __syscall_return (pid_t); } - +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/sh/vfork.S b/libc/sysdeps/linux/sh/vfork.S index 981928e08..f3c20a9d6 100644 --- a/libc/sysdeps/linux/sh/vfork.S +++ b/libc/sysdeps/linux/sh/vfork.S @@ -32,9 +32,11 @@ and the process ID of the new process to the old process. */ .text -.align 4 +.globl __vfork +.hidden __vfork .type __vfork,@function -.globl __vfork; +.align 4 + __vfork: mov.w .L2, r3 trapa #0x10 @@ -104,9 +106,9 @@ __vfork: .word __NR_vfork .L3: .word __NR_fork - .size __vfork, .-__vfork -.weak vfork - vfork = __vfork + +.size __vfork, .-__vfork +strong_alias(__vfork,vfork) #include "syscall_error.S" diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S index c382f4b4e..dfa109dcd 100644 --- a/libc/sysdeps/linux/sparc/fork.S +++ b/libc/sysdeps/linux/sparc/fork.S @@ -19,14 +19,16 @@ /* Code taken from glibc2.2.2/sysdeps/unix/sysv/linux/sparc/vfork.S */ +#include <features.h> #include <sys/syscall.h> .text -.global __libc_fork -.type __libc_fork,%function +.global __fork +.hidden __fork +.type __fork,%function .align 4 -__libc_fork: +__fork: mov __NR_fork, %g1 ta 0x10 bcc,a 9000f @@ -43,7 +45,6 @@ __libc_fork: retl and %o0, %o1, %o0 -.size __libc_fork,.-__libc_fork - -.weak fork - fork = __libc_fork +.size __fork,.-__fork +strong_alias(__fork,fork) +weak_alias(fork,__libc_fork) diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S index 854b66182..9b7092c98 100644 --- a/libc/sysdeps/linux/sparc/vfork.S +++ b/libc/sysdeps/linux/sparc/vfork.S @@ -23,14 +23,16 @@ #ifndef __NR_vfork /* No vfork so use fork instead */ -.weak vfork - vfork = __libc_fork + +hidden_strong_alias(__fork,__vfork) +weak_alias(vfork,__libc_fork) #else .text -.global vfork -.type vfork,%function +.global __vfork +.hidden __vfork +.type __vfork,%function .align 4 __vfork: @@ -51,8 +53,5 @@ __vfork: and %o0, %o1, %o0 .size __vfork,.-__vfork - -.weak vfork - vfork = __vfork - #endif /* __NR_vfork */ +strong_alias(__vfork,vfork) diff --git a/libc/sysdeps/linux/x86_64/vfork.S b/libc/sysdeps/linux/x86_64/vfork.S index dde29e96a..5786058d2 100644 --- a/libc/sysdeps/linux/x86_64/vfork.S +++ b/libc/sysdeps/linux/x86_64/vfork.S @@ -16,6 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <features.h> #include <sys/syscall.h> /* Clone the calling process, but without copying the whole address space. @@ -25,15 +26,17 @@ #ifndef __NR_vfork /* No vfork so use fork instead */ -.weak vfork - vfork = __libc_fork +hidden_strong_alias(__fork,__vfork) +weak_alias(vfork,__libc_fork) #else .text .global __vfork +.hidden __vfork .type __vfork,%function .align 16 + __vfork: /* Pop the return PC value into RDI. We need a register that @@ -58,7 +61,5 @@ __error: .size __vfork,.-__vfork -.weak vfork - vfork = __vfork - #endif /* __NR_vfork */ +strong_alias(__vfork,vfork) |