From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/sysdeps/linux/alpha/__longjmp.S | 1 + libc/sysdeps/linux/alpha/brk.S | 12 +++---- libc/sysdeps/linux/alpha/clone.S | 14 +++----- libc/sysdeps/linux/arm/__longjmp.S | 1 + libc/sysdeps/linux/arm/brk.c | 4 +-- libc/sysdeps/linux/arm/clone.S | 13 +++---- libc/sysdeps/linux/arm/ioperm.c | 26 +++++++++----- libc/sysdeps/linux/arm/iopl.c | 2 ++ libc/sysdeps/linux/arm/mmap64.S | 2 +- libc/sysdeps/linux/arm/sigaction.c | 14 ++++---- libc/sysdeps/linux/arm/vfork.S | 11 +++--- libc/sysdeps/linux/bfin/brk.c | 10 ++++-- libc/sysdeps/linux/bfin/vfork.S | 3 +- libc/sysdeps/linux/common/__rt_sigtimedwait.c | 15 ++++---- libc/sysdeps/linux/common/__syscall_fcntl.c | 25 ++++++++------ libc/sysdeps/linux/common/__syscall_fcntl64.c | 11 +++--- libc/sysdeps/linux/common/_exit.c | 7 ++-- libc/sysdeps/linux/common/adjtimex.c | 9 +++-- libc/sysdeps/linux/common/alarm.c | 12 ++++--- libc/sysdeps/linux/common/chdir.c | 5 +-- libc/sysdeps/linux/common/chmod.c | 5 +-- libc/sysdeps/linux/common/clock_getres.c | 4 +-- libc/sysdeps/linux/common/clock_gettime.c | 4 +-- libc/sysdeps/linux/common/clock_settime.c | 4 +-- libc/sysdeps/linux/common/close.c | 9 ++--- libc/sysdeps/linux/common/cmsg_nxthdr.c | 7 ++-- libc/sysdeps/linux/common/creat64.c | 4 +-- libc/sysdeps/linux/common/dl-osinfo.h | 13 ++++--- libc/sysdeps/linux/common/dup2.c | 6 ++-- libc/sysdeps/linux/common/execve.c | 5 +-- libc/sysdeps/linux/common/fchdir.c | 6 ++-- libc/sysdeps/linux/common/fork.c | 9 ++--- libc/sysdeps/linux/common/fstat.c | 13 ++++--- libc/sysdeps/linux/common/fstat64.c | 6 ++-- libc/sysdeps/linux/common/fstatfs.c | 6 ++-- libc/sysdeps/linux/common/fsync.c | 2 +- libc/sysdeps/linux/common/ftruncate.c | 3 +- libc/sysdeps/linux/common/ftruncate64.c | 4 +-- libc/sysdeps/linux/common/getcwd.c | 50 +++++++++++++++++---------- libc/sysdeps/linux/common/getdents.c | 7 ++-- libc/sysdeps/linux/common/getdents64.c | 7 ++-- libc/sysdeps/linux/common/getdirname.c | 20 ++++++----- libc/sysdeps/linux/common/getdnnm.c | 20 +++++++---- libc/sysdeps/linux/common/getdtablesize.c | 9 ++--- libc/sysdeps/linux/common/getegid.c | 11 +++--- libc/sysdeps/linux/common/geteuid.c | 11 +++--- libc/sysdeps/linux/common/getgid.c | 5 +-- libc/sysdeps/linux/common/getgroups.c | 9 ++--- libc/sysdeps/linux/common/gethstnm.c | 21 +++++++---- libc/sysdeps/linux/common/getpagesize.c | 16 +++++---- libc/sysdeps/linux/common/getpgid.c | 3 +- libc/sysdeps/linux/common/getpid.c | 12 +++---- libc/sysdeps/linux/common/getpriority.c | 5 +-- libc/sysdeps/linux/common/getrlimit.c | 7 ++-- libc/sysdeps/linux/common/getrlimit64.c | 4 +-- libc/sysdeps/linux/common/getsid.c | 5 +-- libc/sysdeps/linux/common/gettimeofday.c | 6 ++-- libc/sysdeps/linux/common/getuid.c | 5 +-- libc/sysdeps/linux/common/ioctl.c | 6 ++-- libc/sysdeps/linux/common/kill.c | 5 +-- libc/sysdeps/linux/common/llseek.c | 18 +++++----- libc/sysdeps/linux/common/longjmp.c | 13 +++---- libc/sysdeps/linux/common/lseek.c | 14 ++++---- libc/sysdeps/linux/common/lstat.c | 13 ++++--- libc/sysdeps/linux/common/lstat64.c | 6 ++-- libc/sysdeps/linux/common/mkdir.c | 5 +-- libc/sysdeps/linux/common/mkfifo.c | 4 +-- libc/sysdeps/linux/common/mknod.c | 5 +-- libc/sysdeps/linux/common/mmap.c | 5 +-- libc/sysdeps/linux/common/mmap64.c | 5 ++- libc/sysdeps/linux/common/modify_ldt.c | 2 +- libc/sysdeps/linux/common/mremap.c | 6 ++-- libc/sysdeps/linux/common/msync.c | 2 +- libc/sysdeps/linux/common/munmap.c | 6 ++-- libc/sysdeps/linux/common/nanosleep.c | 5 +-- libc/sysdeps/linux/common/nice.c | 7 ++-- libc/sysdeps/linux/common/ntp_gettime.c | 6 ++-- libc/sysdeps/linux/common/open.c | 14 ++++---- libc/sysdeps/linux/common/open64.c | 14 +++++--- libc/sysdeps/linux/common/pause.c | 8 ++--- libc/sysdeps/linux/common/pipe.c | 6 ++-- libc/sysdeps/linux/common/poll.c | 46 ++++++++++++------------ libc/sysdeps/linux/common/posix_fadvise.c | 6 +--- libc/sysdeps/linux/common/posix_fadvise64.c | 2 +- libc/sysdeps/linux/common/pread_write.c | 35 +++++++++++-------- libc/sysdeps/linux/common/read.c | 9 ++--- libc/sysdeps/linux/common/readlink.c | 6 ++-- libc/sysdeps/linux/common/rmdir.c | 6 ++-- libc/sysdeps/linux/common/sbrk.c | 12 ++++--- libc/sysdeps/linux/common/select.c | 10 +++--- libc/sysdeps/linux/common/setegid.c | 10 ++++-- libc/sysdeps/linux/common/seteuid.c | 14 +++++--- libc/sysdeps/linux/common/setgroups.c | 9 ++--- libc/sysdeps/linux/common/setitimer.c | 6 ++-- libc/sysdeps/linux/common/setpgid.c | 5 +-- libc/sysdeps/linux/common/setpgrp.c | 8 ++++- libc/sysdeps/linux/common/setpriority.c | 6 ++-- libc/sysdeps/linux/common/setregid.c | 4 +-- libc/sysdeps/linux/common/setresgid.c | 5 +-- libc/sysdeps/linux/common/setresuid.c | 5 +-- libc/sysdeps/linux/common/setreuid.c | 5 +-- libc/sysdeps/linux/common/setrlimit.c | 8 ++--- libc/sysdeps/linux/common/setrlimit64.c | 4 +-- libc/sysdeps/linux/common/setsid.c | 6 ++-- libc/sysdeps/linux/common/settimeofday.c | 6 ++-- libc/sysdeps/linux/common/sigprocmask.c | 7 ++-- libc/sysdeps/linux/common/sigsuspend.c | 7 ++-- libc/sysdeps/linux/common/ssp.c | 38 +++++++++++--------- libc/sysdeps/linux/common/stat.c | 13 ++++--- libc/sysdeps/linux/common/stat64.c | 6 ++-- libc/sysdeps/linux/common/statfs.c | 5 +-- libc/sysdeps/linux/common/time.c | 12 +++---- libc/sysdeps/linux/common/times.c | 6 ++-- libc/sysdeps/linux/common/truncate.c | 3 +- libc/sysdeps/linux/common/truncate64.c | 5 ++- libc/sysdeps/linux/common/ulimit.c | 8 ++--- libc/sysdeps/linux/common/uname.c | 6 ++-- libc/sysdeps/linux/common/unlink.c | 6 ++-- libc/sysdeps/linux/common/utime.c | 15 ++++---- libc/sysdeps/linux/common/utimes.c | 13 +++---- libc/sysdeps/linux/common/vfork.c | 9 ++--- libc/sysdeps/linux/common/wait.c | 14 +++++--- libc/sysdeps/linux/common/wait3.c | 7 +++- libc/sysdeps/linux/common/wait4.c | 5 +-- libc/sysdeps/linux/common/waitpid.c | 17 ++++++--- libc/sysdeps/linux/common/write.c | 11 +++--- libc/sysdeps/linux/cris/brk.c | 5 +-- libc/sysdeps/linux/cris/clone.S | 9 ++--- libc/sysdeps/linux/cris/fork.c | 4 ++- libc/sysdeps/linux/cris/sbrk.c | 7 ++-- libc/sysdeps/linux/cris/setjmp.S | 9 ----- libc/sysdeps/linux/e1/longjmp.c | 4 ++- libc/sysdeps/linux/frv/brk.c | 5 +-- libc/sysdeps/linux/frv/clone.S | 13 +++---- libc/sysdeps/linux/frv/fstat.c | 6 ++-- libc/sysdeps/linux/frv/fstat64.c | 6 ++-- libc/sysdeps/linux/frv/lstat.c | 6 ++-- libc/sysdeps/linux/frv/lstat64.c | 6 ++-- libc/sysdeps/linux/frv/mmap.c | 5 +-- libc/sysdeps/linux/frv/sbrk.c | 7 ++-- libc/sysdeps/linux/frv/stat.c | 6 ++-- libc/sysdeps/linux/frv/stat64.c | 6 ++-- libc/sysdeps/linux/frv/vfork.S | 11 +++--- libc/sysdeps/linux/h8300/brk.c | 5 +-- libc/sysdeps/linux/h8300/clone.S | 10 ------ libc/sysdeps/linux/h8300/vfork.S | 1 + libc/sysdeps/linux/hppa/__longjmp.S | 3 ++ libc/sysdeps/linux/hppa/brk.c | 7 ++-- libc/sysdeps/linux/hppa/clone.S | 13 +++---- libc/sysdeps/linux/hppa/mmap.c | 6 ++-- libc/sysdeps/linux/i386/__longjmp.S | 3 ++ libc/sysdeps/linux/i386/brk.c | 5 +-- libc/sysdeps/linux/i386/clone.S | 11 +++--- libc/sysdeps/linux/i386/mmap.S | 13 ++++--- libc/sysdeps/linux/i386/sigaction.c | 11 +++--- libc/sysdeps/linux/i386/vfork.S | 15 ++++---- libc/sysdeps/linux/m68k/__longjmp.S | 1 + libc/sysdeps/linux/m68k/brk.c | 5 +-- libc/sysdeps/linux/m68k/clone.S | 13 ++----- libc/sysdeps/linux/m68k/vfork.S | 11 +++--- libc/sysdeps/linux/microblaze/__longjmp.S | 2 ++ libc/sysdeps/linux/microblaze/longjmp.S | 2 ++ libc/sysdeps/linux/microblaze/mmap.c | 2 ++ libc/sysdeps/linux/microblaze/vfork.S | 7 ++-- libc/sysdeps/linux/mips/__longjmp.c | 2 ++ libc/sysdeps/linux/mips/brk.c | 5 +-- libc/sysdeps/linux/mips/clone.S | 13 +++---- libc/sysdeps/linux/mips/mmap.c | 6 ++-- libc/sysdeps/linux/mips/pipe.S | 11 +++--- libc/sysdeps/linux/mips/pipe.c | 3 +- libc/sysdeps/linux/mips/pread_write.c | 8 ++--- libc/sysdeps/linux/mips/sigaction.c | 11 +++--- libc/sysdeps/linux/nios/__longjmp.S | 8 +---- libc/sysdeps/linux/nios/brk.c | 5 +-- libc/sysdeps/linux/nios/clone.S | 11 +++--- libc/sysdeps/linux/nios/vfork.S | 10 +++--- libc/sysdeps/linux/nios2/__longjmp.S | 1 + libc/sysdeps/linux/nios2/brk.c | 5 +-- libc/sysdeps/linux/nios2/clone.S | 11 +++--- libc/sysdeps/linux/nios2/vfork.S | 11 +++--- libc/sysdeps/linux/powerpc/__longjmp.S | 2 ++ libc/sysdeps/linux/powerpc/brk.S | 13 ++++--- libc/sysdeps/linux/powerpc/clone.S | 12 +++---- libc/sysdeps/linux/powerpc/ioctl.c | 11 +++--- libc/sysdeps/linux/powerpc/mmap.c | 5 +-- libc/sysdeps/linux/powerpc/pread_write.c | 35 ++++++++++--------- libc/sysdeps/linux/powerpc/vfork.S | 15 ++++---- libc/sysdeps/linux/powerpc/vfork.c | 5 +-- libc/sysdeps/linux/sh/__longjmp.S | 3 +- libc/sysdeps/linux/sh/brk.c | 5 +-- libc/sysdeps/linux/sh/clone.S | 13 +++---- libc/sysdeps/linux/sh/longjmp.c | 1 + libc/sysdeps/linux/sh/mmap.c | 6 ++-- libc/sysdeps/linux/sh/pipe.c | 3 +- libc/sysdeps/linux/sh/pread_write.c | 8 ++--- libc/sysdeps/linux/sh/sbrk.c | 7 ++-- libc/sysdeps/linux/sh/vfork.S | 12 +++---- libc/sysdeps/linux/sh64/brk.c | 5 +-- libc/sysdeps/linux/sparc/__longjmp.S | 3 ++ libc/sysdeps/linux/sparc/brk.c | 5 +-- libc/sysdeps/linux/sparc/clone.S | 14 ++++---- libc/sysdeps/linux/sparc/fork.S | 13 ++++--- libc/sysdeps/linux/sparc/vfork.S | 15 ++++---- libc/sysdeps/linux/v850/__longjmp.S | 2 ++ libc/sysdeps/linux/v850/mmap.c | 2 ++ libc/sysdeps/linux/v850/vfork.S | 8 ++--- libc/sysdeps/linux/x86_64/__longjmp.S | 2 ++ libc/sysdeps/linux/x86_64/brk.c | 5 +-- libc/sysdeps/linux/x86_64/clone.S | 13 +++---- libc/sysdeps/linux/x86_64/mmap.c | 6 ++-- libc/sysdeps/linux/x86_64/sigaction.c | 14 ++++---- libc/sysdeps/linux/x86_64/vfork.S | 15 ++++---- 212 files changed, 980 insertions(+), 841 deletions(-) (limited to 'libc/sysdeps/linux') diff --git a/libc/sysdeps/linux/alpha/__longjmp.S b/libc/sysdeps/linux/alpha/__longjmp.S index b78489f53..910ec0781 100644 --- a/libc/sysdeps/linux/alpha/__longjmp.S +++ b/libc/sysdeps/linux/alpha/__longjmp.S @@ -54,3 +54,4 @@ __longjmp: ret .end __longjmp +libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/alpha/brk.S b/libc/sysdeps/linux/alpha/brk.S index a3f2edfe7..de0a7563f 100644 --- a/libc/sysdeps/linux/alpha/brk.S +++ b/libc/sysdeps/linux/alpha/brk.S @@ -38,12 +38,11 @@ __curbrk: .skip 8 #endif .text -.globl __brk; -.hidden __brk; +.globl brk; .align 3; -.ent __brk , 0; +.ent brk , 0; -__brk: +brk: .frame $30 , 8 , $26 ldgp $29, 0($27) subq $30, 8, $30 @@ -77,7 +76,6 @@ $err0: ldi $0, ENOMEM $err1: addq $30, 8, $30 jmp $31, __syscall_error - .end __brk + .end brk -.weak brk; - brk = __brk +libc_hidden_def(brk) diff --git a/libc/sysdeps/linux/alpha/clone.S b/libc/sysdeps/linux/alpha/clone.S index ed5a4f487..9db118afd 100644 --- a/libc/sysdeps/linux/alpha/clone.S +++ b/libc/sysdeps/linux/alpha/clone.S @@ -29,11 +29,11 @@ /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */ .text -.globl __clone; +.globl clone; .align 3; -.ent __clone , 0; +.ent clone , 0; -__clone: +clone: .frame $30 , 0, $26 .prologue 0 @@ -64,7 +64,7 @@ $error: 1: ldgp gp,0(gp) jmp zero,__syscall_error -.end __clone +.end clone /* Load up the arguments to the function. Put this block of code in its own function so that we can terminate the stack trace with our @@ -87,13 +87,9 @@ thread_start: /* Call _exit rather than doing it inline for breakpoint purposes */ mov v0,a0 - jsr ra,_exit_internal + jsr ra,HIDDEN_JUMPTARGET(_exit) /* Die horribly. */ halt .end thread_start - -.weak clone; - clone = __clone - diff --git a/libc/sysdeps/linux/arm/__longjmp.S b/libc/sysdeps/linux/arm/__longjmp.S index 822e15a69..ee588b2c8 100644 --- a/libc/sysdeps/linux/arm/__longjmp.S +++ b/libc/sysdeps/linux/arm/__longjmp.S @@ -60,3 +60,4 @@ __longjmp: ldmia ip , {v1-v6, sl, fp, sp, pc} .size __longjmp,.-__longjmp +libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/arm/brk.c b/libc/sysdeps/linux/arm/brk.c index e711db3b1..88f489e26 100644 --- a/libc/sysdeps/linux/arm/brk.c +++ b/libc/sysdeps/linux/arm/brk.c @@ -24,7 +24,7 @@ /* This must be initialized data because commons can't have aliases. */ void *__curbrk = 0; -int attribute_hidden __brk (void *addr) +int brk (void *addr) { void *newbrk = (void*)INTERNAL_SYSCALL(brk, , 1, addr); @@ -37,4 +37,4 @@ int attribute_hidden __brk (void *addr) return 0; } -strong_alias(__brk,brk) +libc_hidden_def(brk) diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S index 946d4bdda..550d43f4d 100644 --- a/libc/sysdeps/linux/arm/clone.S +++ b/libc/sysdeps/linux/arm/clone.S @@ -28,10 +28,10 @@ /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ .text -.global __clone -.type __clone,%function +.global clone +.type clone,%function .align 4 -__clone: +clone: @ sanity check args cmp r0, #0 cmpne r1, #0 @@ -59,14 +59,11 @@ __clone: ldr pc, [sp] @ and we are done, passing the return value through r0 - b _exit_internal + b HIDDEN_JUMPTARGET(_exit) __error: b __syscall_error -.size __clone,.-__clone - -.weak clone - clone = __clone +.size clone,.-clone #endif diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c index 0c0c21182..ed370d551 100644 --- a/libc/sysdeps/linux/arm/ioperm.c +++ b/libc/sysdeps/linux/arm/ioperm.c @@ -33,12 +33,6 @@ the area affected (this is a kernel limitation). So we now just enable all the ports all of the time. */ -#define readlink __readlink -#define mmap __mmap -#define sscanf __sscanf -#define fscanf __fscanf -#define fgets __fgets - #include #include #include @@ -53,6 +47,18 @@ #include #include +libc_hidden_proto(readlink) +libc_hidden_proto(mmap) +libc_hidden_proto(sscanf) +libc_hidden_proto(fscanf) +libc_hidden_proto(fprintf) +libc_hidden_proto(fgets) +libc_hidden_proto(fopen) +libc_hidden_proto(fclose) +libc_hidden_proto(strcmp) +libc_hidden_proto(open) +libc_hidden_proto(close) + #include #define PATH_ARM_SYSTYPE "/etc/arm_systype" @@ -163,7 +169,7 @@ init_iosys (void) /* translate systype name into i/o system: */ for (i = 0; i < sizeof (platform) / sizeof (platform[0]); ++i) { - if (__strcmp (platform[i].name, systype) == 0) { + if (strcmp (platform[i].name, systype) == 0) { io.shift = platform[i].shift; io.io_base = platform[i].io_base; io.initdone = 1; @@ -191,14 +197,14 @@ int ioperm (unsigned long int from, unsigned long int num, int turn_on) if (! io.base) { int fd; - fd = __open ("/dev/mem", O_RDWR); + fd = open ("/dev/mem", O_RDWR); if (fd < 0) return -1; io.base = (unsigned long int) mmap (0, MAX_PORT << io.shift, PROT_READ | PROT_WRITE, MAP_SHARED, fd, io.io_base); - __close (fd); + close (fd); if ((long) io.base == -1) return -1; } @@ -206,6 +212,8 @@ int ioperm (unsigned long int from, unsigned long int num, int turn_on) return 0; } +libc_hidden_proto(ioperm) +libc_hidden_def(ioperm) void diff --git a/libc/sysdeps/linux/arm/iopl.c b/libc/sysdeps/linux/arm/iopl.c index 0cd306d42..552ba6c67 100644 --- a/libc/sysdeps/linux/arm/iopl.c +++ b/libc/sysdeps/linux/arm/iopl.c @@ -21,6 +21,8 @@ #include #include +libc_hidden_proto(ioperm) + #define MAX_PORT 0x10000 int iopl(int level) diff --git a/libc/sysdeps/linux/arm/mmap64.S b/libc/sysdeps/linux/arm/mmap64.S index dd6f3c477..784d73440 100644 --- a/libc/sysdeps/linux/arm/mmap64.S +++ b/libc/sysdeps/linux/arm/mmap64.S @@ -52,7 +52,7 @@ mmap64: mov r0, ip @ first arg was clobbered teq r5, $0 ldmeqfd sp!, {r4, r5, lr} - beq __mmap + beq HIDDEN_JUMPTARGET(mmap) .Linval: mov r0, $-EINVAL ldmfd sp!, {r4, r5, lr} diff --git a/libc/sysdeps/linux/arm/sigaction.c b/libc/sysdeps/linux/arm/sigaction.c index c2f79c337..3d3112a29 100644 --- a/libc/sysdeps/linux/arm/sigaction.c +++ b/libc/sysdeps/linux/arm/sigaction.c @@ -39,10 +39,9 @@ extern void __default_rt_sa_restorer(void); __default_sa_restorer #endif - - #ifdef __NR_rt_sigaction +libc_hidden_proto(memcpy) /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ @@ -53,7 +52,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa if (act) { kact.k_sa_handler = act->sa_handler; - __memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); kact.sa_flags = act->sa_flags; # ifdef HAVE_SA_RESTORER /* If the user specified SA_ONSTACK this means she is trying to @@ -78,7 +77,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); if (oact && result >= 0) { oact->sa_handler = koact.k_sa_handler; - __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); + memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); oact->sa_flags = koact.sa_flags; # ifdef HAVE_SA_RESTORER oact->sa_restorer = koact.sa_restorer; @@ -90,8 +89,6 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa #else - - /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) @@ -129,6 +126,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa #endif #ifndef LIBC_SIGACTION -hidden_weak_alias(__libc_sigaction,__sigaction) -weak_alias(__libc_sigaction,sigaction) +strong_alias(__libc_sigaction,sigaction) +libc_hidden_proto(sigaction) +libc_hidden_def(sigaction) #endif diff --git a/libc/sysdeps/linux/arm/vfork.S b/libc/sysdeps/linux/arm/vfork.S index 68798995a..0bf97c223 100644 --- a/libc/sysdeps/linux/arm/vfork.S +++ b/libc/sysdeps/linux/arm/vfork.S @@ -16,12 +16,11 @@ #ifdef __NR_fork .text -.global __vfork -.hidden __vfork -.type __vfork,%function +.global vfork +.type vfork,%function .align 4 -__vfork: +vfork: #ifdef __NR_vfork swi __NR_vfork @@ -44,6 +43,6 @@ __vfork: __error: b __syscall_error -.size __vfork,.-__vfork -strong_alias(__vfork,vfork) +.size vfork,.-vfork +libc_hidden_def(vfork) #endif diff --git a/libc/sysdeps/linux/bfin/brk.c b/libc/sysdeps/linux/bfin/brk.c index 1cb30216d..334bf6fc0 100644 --- a/libc/sysdeps/linux/bfin/brk.c +++ b/libc/sysdeps/linux/bfin/brk.c @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include #include @@ -6,7 +11,7 @@ /* This must be initialized data because commons can't have aliases. */ void * __curbrk = 0; -int attribute_hidden __brk (void *addr) +int brk (void *addr) { void *newbrk; @@ -28,4 +33,5 @@ int attribute_hidden __brk (void *addr) return 0; } -strong_alias(__brk,brk) +libc_hidden_proto(brk) +libc_hidden_def(brk) diff --git a/libc/sysdeps/linux/bfin/vfork.S b/libc/sysdeps/linux/bfin/vfork.S index 1f9539c55..694265b7a 100644 --- a/libc/sysdeps/linux/bfin/vfork.S +++ b/libc/sysdeps/linux/bfin/vfork.S @@ -1,4 +1,4 @@ - +#include #include .text .globl _vfork @@ -10,3 +10,4 @@ _vfork: p0 = __NR_vfork; excpt 0; rts; +libc_hidden_def(_vfork) diff --git a/libc/sysdeps/linux/common/__rt_sigtimedwait.c b/libc/sysdeps/linux/common/__rt_sigtimedwait.c index 09409fe81..43c6b6517 100644 --- a/libc/sysdeps/linux/common/__rt_sigtimedwait.c +++ b/libc/sysdeps/linux/common/__rt_sigtimedwait.c @@ -16,18 +16,18 @@ static _syscall4(int, __rt_sigtimedwait, const sigset_t *, set, siginfo_t *, info, const struct timespec *, timeout, size_t, setsize); -int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) +int sigwaitinfo(const sigset_t * set, siginfo_t * info) { return __rt_sigtimedwait(set, info, NULL, _NSIG / 8); } -int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, +int sigtimedwait(const sigset_t * set, siginfo_t * info, const struct timespec *timeout) { return __rt_sigtimedwait(set, info, timeout, _NSIG / 8); } #else -int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) +int sigwaitinfo(const sigset_t * set, siginfo_t * info) { if (set == NULL) __set_errno(EINVAL); @@ -36,7 +36,7 @@ int attribute_hidden __sigwaitinfo(const sigset_t * set, siginfo_t * info) return -1; } -int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, +int sigtimedwait(const sigset_t * set, siginfo_t * info, const struct timespec *timeout) { if (set == NULL) @@ -46,6 +46,7 @@ int attribute_hidden __sigtimedwait(const sigset_t * set, siginfo_t * info, return -1; } #endif -/* keep these weak so that libpthread can overwrite them */ -weak_alias(__sigtimedwait,sigtimedwait) -weak_alias(__sigwaitinfo,sigwaitinfo) +libc_hidden_proto(sigwaitinfo) +libc_hidden_def(sigwaitinfo) +libc_hidden_proto(sigtimedwait) +libc_hidden_def(sigtimedwait) diff --git a/libc/sysdeps/linux/common/__syscall_fcntl.c b/libc/sysdeps/linux/common/__syscall_fcntl.c index ca9aff5e7..f8652def6 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl.c @@ -11,18 +11,16 @@ #include #include -#undef __fcntl - #if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64 -extern int __fcntl64(int fd, int cmd, ...) attribute_hidden; +extern int __libc_fcntl64(int fd, int cmd, ...); +libc_hidden_proto(__libc_fcntl64) #endif -#undef fcntl #define __NR___syscall_fcntl __NR_fcntl static inline _syscall3(int, __syscall_fcntl, int, fd, int, cmd, long, arg); -int attribute_hidden __fcntl(int fd, int cmd, ...) +int __libc_fcntl(int fd, int cmd, ...) { long arg; va_list list; @@ -33,7 +31,7 @@ int attribute_hidden __fcntl(int fd, int cmd, ...) if (cmd == F_GETLK64 || cmd == F_SETLK64 || cmd == F_SETLKW64) { #if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64 - return __fcntl64(fd, cmd, arg); + return __libc_fcntl64(fd, cmd, arg); #else __set_errno(ENOSYS); return -1; @@ -41,10 +39,15 @@ int attribute_hidden __fcntl(int fd, int cmd, ...) } return (__syscall_fcntl(fd, cmd, arg)); } -strong_alias(__fcntl,fcntl) -weak_alias(__fcntl,__libc_fcntl) +libc_hidden_proto(__libc_fcntl) +libc_hidden_def(__libc_fcntl) + +strong_alias(__libc_fcntl,fcntl) +libc_hidden_proto(fcntl) +libc_hidden_def(fcntl) #if ! defined __NR_fcntl64 && defined __UCLIBC_HAS_LFS__ -hidden_strong_alias(__fcntl,__fcntl64) -weak_alias(__fcntl,fcntl64) -weak_alias(__fcntl,__libc_fcntl64) +strong_alias(__libc_fcntl,__libc_fcntl64) +strong_alias(__libc_fcntl,fcntl64) +libc_hidden_proto(fcntl64) +libc_hidden_def(fcntl64) #endif diff --git a/libc/sysdeps/linux/common/__syscall_fcntl64.c b/libc/sysdeps/linux/common/__syscall_fcntl64.c index 9231808e3..759ba949f 100644 --- a/libc/sysdeps/linux/common/__syscall_fcntl64.c +++ b/libc/sysdeps/linux/common/__syscall_fcntl64.c @@ -12,10 +12,9 @@ #include #if defined __UCLIBC_HAS_LFS__ && defined __NR_fcntl64 -#undef fcntl64 #define __NR___syscall_fcntl64 __NR_fcntl64 static inline _syscall3(int, __syscall_fcntl64, int, fd, int, cmd, long, arg); -int attribute_hidden __fcntl64(int fd, int cmd, ...) +int __libc_fcntl64(int fd, int cmd, ...) { long arg; va_list list; @@ -26,6 +25,10 @@ int attribute_hidden __fcntl64(int fd, int cmd, ...) va_end(list); return (__syscall_fcntl64(fd, cmd, arg)); } -strong_alias(__fcntl64,fcntl64) -weak_alias(__fcntl64,__libc_fcntl64) +libc_hidden_proto(__libc_fcntl64) +libc_hidden_def(__libc_fcntl64) + +strong_alias(__libc_fcntl64,fcntl64) +libc_hidden_proto(fcntl64) +libc_hidden_def(fcntl64) #endif diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c index 4e450bbc5..a708fad90 100644 --- a/libc/sysdeps/linux/common/_exit.c +++ b/libc/sysdeps/linux/common/_exit.c @@ -32,12 +32,11 @@ static inline _syscall1(void, __syscall_exit, int, status); #endif -#undef _exit -#undef _exit_internal -void attribute_noreturn attribute_hidden _exit_internal(int status) +void attribute_noreturn _exit(int status) { /* The loop is added only to keep gcc happy. */ while(1) INLINE_SYSCALL(exit, 1, status); } -strong_alias(_exit_internal,_exit) +libc_hidden_proto(_exit) +libc_hidden_def(_exit) diff --git a/libc/sysdeps/linux/common/adjtimex.c b/libc/sysdeps/linux/common/adjtimex.c index ef33051e8..a6c9be2b8 100644 --- a/libc/sysdeps/linux/common/adjtimex.c +++ b/libc/sysdeps/linux/common/adjtimex.c @@ -10,8 +10,7 @@ #include "syscalls.h" #include -#define __NR___adjtimex __NR_adjtimex -attribute_hidden _syscall1(int, __adjtimex, struct timex *, buf); - -strong_alias(__adjtimex, adjtimex) -weak_alias(__adjtimex, ntp_adjtime) +_syscall1(int, adjtimex, struct timex *, buf); +libc_hidden_proto(adjtimex) +libc_hidden_def(adjtimex) +strong_alias(adjtimex,ntp_adjtime) diff --git a/libc/sysdeps/linux/common/alarm.c b/libc/sysdeps/linux/common/alarm.c index 8239cec5b..6089a50cf 100644 --- a/libc/sysdeps/linux/common/alarm.c +++ b/libc/sysdeps/linux/common/alarm.c @@ -7,16 +7,17 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define setitimer __setitimer - #include "syscalls.h" #include #ifdef __NR_alarm #define __NR___alarm __NR_alarm -attribute_hidden _syscall1(unsigned int, __alarm, unsigned int, seconds); +_syscall1(unsigned int, alarm, unsigned int, seconds); #else #include -unsigned int attribute_hidden __alarm(unsigned int seconds) + +libc_hidden_proto(setitimer) + +unsigned int alarm(unsigned int seconds) { struct itimerval old, new; unsigned int retval; @@ -35,4 +36,5 @@ unsigned int attribute_hidden __alarm(unsigned int seconds) return retval; } #endif -strong_alias(__alarm,alarm) +libc_hidden_proto(alarm) +libc_hidden_def(alarm) diff --git a/libc/sysdeps/linux/common/chdir.c b/libc/sysdeps/linux/common/chdir.c index ff4ba527b..230f86eb9 100644 --- a/libc/sysdeps/linux/common/chdir.c +++ b/libc/sysdeps/linux/common/chdir.c @@ -13,8 +13,9 @@ #define __NR___syscall_chdir __NR_chdir static inline _syscall1(int, __syscall_chdir, const char *, path); -int attribute_hidden __chdir(const char *path) +int chdir(const char *path) { return __syscall_chdir(path); } -strong_alias(__chdir,chdir) +libc_hidden_proto(chdir) +libc_hidden_def(chdir) diff --git a/libc/sysdeps/linux/common/chmod.c b/libc/sysdeps/linux/common/chmod.c index bf368cf5e..d6be1e130 100644 --- a/libc/sysdeps/linux/common/chmod.c +++ b/libc/sysdeps/linux/common/chmod.c @@ -13,8 +13,9 @@ #define __NR___syscall_chmod __NR_chmod static inline _syscall2(int, __syscall_chmod, const char *, path, __kernel_mode_t, mode); -int attribute_hidden __chmod(const char *path, mode_t mode) +int chmod(const char *path, mode_t mode) { return __syscall_chmod(path, mode); } -strong_alias(__chmod,chmod) +libc_hidden_proto(chmod) +libc_hidden_def(chmod) diff --git a/libc/sysdeps/linux/common/clock_getres.c b/libc/sysdeps/linux/common/clock_getres.c index 7aff495d0..985426444 100644 --- a/libc/sysdeps/linux/common/clock_getres.c +++ b/libc/sysdeps/linux/common/clock_getres.c @@ -19,8 +19,6 @@ * */ -#define sysconf __sysconf - #define _GNU_SOURCE #include "syscalls.h" #include @@ -29,6 +27,8 @@ #ifdef __NR_clock_getres _syscall2(int, clock_getres, clockid_t, clock_id, struct timespec*, res); #else +libc_hidden_proto(sysconf) + int clock_getres(clockid_t clock_id, struct timespec* res) { long clk_tck; diff --git a/libc/sysdeps/linux/common/clock_gettime.c b/libc/sysdeps/linux/common/clock_gettime.c index 33863a828..e72432b3c 100644 --- a/libc/sysdeps/linux/common/clock_gettime.c +++ b/libc/sysdeps/linux/common/clock_gettime.c @@ -20,8 +20,6 @@ * */ -#define gettimeofday __gettimeofday - #define _GNU_SOURCE #include "syscalls.h" #include @@ -30,6 +28,8 @@ #ifdef __NR_clock_gettime _syscall2(int, clock_gettime, clockid_t, clock_id, struct timespec*, tp); #else +libc_hidden_proto(gettimeofday) + int clock_gettime(clockid_t clock_id, struct timespec* tp) { struct timeval tv; diff --git a/libc/sysdeps/linux/common/clock_settime.c b/libc/sysdeps/linux/common/clock_settime.c index e2ec03f78..88d5df93e 100644 --- a/libc/sysdeps/linux/common/clock_settime.c +++ b/libc/sysdeps/linux/common/clock_settime.c @@ -19,8 +19,6 @@ * */ -#define settimeofday __settimeofday - #define _GNU_SOURCE #include "syscalls.h" #include @@ -29,6 +27,8 @@ #ifdef __NR_clock_settime _syscall2(int, clock_settime, clockid_t, clock_id, const struct timespec*, tp); #else +libc_hidden_proto(settimeofday) + int clock_settime(clockid_t clock_id, const struct timespec* tp) { struct timeval tv; diff --git a/libc/sysdeps/linux/common/close.c b/libc/sysdeps/linux/common/close.c index 2e9c2073d..38381a223 100644 --- a/libc/sysdeps/linux/common/close.c +++ b/libc/sysdeps/linux/common/close.c @@ -10,7 +10,8 @@ #include "syscalls.h" #include -#define __NR___close __NR_close -attribute_hidden _syscall1(int, __close, int, fd); -strong_alias(__close,close) -weak_alias(__close,__libc_close) +#define __NR___libc_close __NR_close +_syscall1(int, __libc_close, int, fd); +strong_alias(__libc_close,close) +libc_hidden_proto(close) +libc_hidden_def(close) diff --git a/libc/sysdeps/linux/common/cmsg_nxthdr.c b/libc/sysdeps/linux/common/cmsg_nxthdr.c index 771f5172b..a2352efe4 100644 --- a/libc/sysdeps/linux/common/cmsg_nxthdr.c +++ b/libc/sysdeps/linux/common/cmsg_nxthdr.c @@ -21,8 +21,8 @@ #include #include -struct cmsghdr attribute_hidden * -__cmsg_nxthdr_internal (struct msghdr *mhdr, struct cmsghdr *cmsg) +struct cmsghdr * +__cmsg_nxthdr (struct msghdr *mhdr, struct cmsghdr *cmsg) { if ((size_t) cmsg->cmsg_len < sizeof (struct cmsghdr)) /* The kernel header does this so there may be a reason. */ @@ -38,4 +38,5 @@ __cmsg_nxthdr_internal (struct msghdr *mhdr, struct cmsghdr *cmsg) return NULL; return cmsg; } -strong_alias(__cmsg_nxthdr_internal,__cmsg_nxthdr) +libc_hidden_proto(__cmsg_nxthdr) +libc_hidden_def(__cmsg_nxthdr) diff --git a/libc/sysdeps/linux/common/creat64.c b/libc/sysdeps/linux/common/creat64.c index 759f5bed8..0bf20f175 100644 --- a/libc/sysdeps/linux/common/creat64.c +++ b/libc/sysdeps/linux/common/creat64.c @@ -16,8 +16,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define open64 __open64 - #include #include #include @@ -37,7 +35,7 @@ # undef __USE_FILE_OFFSET64 #endif -#undef creat +libc_hidden_proto(open64) /* Create FILE with protections MODE. */ int creat64 (const char *file, mode_t mode) diff --git a/libc/sysdeps/linux/common/dl-osinfo.h b/libc/sysdeps/linux/common/dl-osinfo.h index b4108cc53..cd791306e 100644 --- a/libc/sysdeps/linux/common/dl-osinfo.h +++ b/libc/sysdeps/linux/common/dl-osinfo.h @@ -7,8 +7,6 @@ #ifndef _DL_OSINFO_H #define _DL_OSINFO_H 1 -#define gettimeofday __gettimeofday - #include #ifdef __UCLIBC_HAS_SSP__ @@ -22,9 +20,14 @@ # include # ifdef IS_IN_libc -# define OPEN __open -# define READ __read -# define CLOSE __close +#include +libc_hidden_proto(open) +libc_hidden_proto(read) +libc_hidden_proto(close) +libc_hidden_proto(gettimeofday) +# define OPEN open +# define READ read +# define CLOSE close # define GETTIMEOFDAY gettimeofday # else # define OPEN _dl_open diff --git a/libc/sysdeps/linux/common/dup2.c b/libc/sysdeps/linux/common/dup2.c index 71164aa0b..c7bd115aa 100644 --- a/libc/sysdeps/linux/common/dup2.c +++ b/libc/sysdeps/linux/common/dup2.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___dup2 __NR_dup2 -attribute_hidden _syscall2(int, __dup2, int, oldfd, int, newfd); -strong_alias(__dup2,dup2) +_syscall2(int, dup2, int, oldfd, int, newfd); +libc_hidden_proto(dup2) +libc_hidden_def(dup2) diff --git a/libc/sysdeps/linux/common/execve.c b/libc/sysdeps/linux/common/execve.c index 8a95746ee..bbc7b1dec 100644 --- a/libc/sysdeps/linux/common/execve.c +++ b/libc/sysdeps/linux/common/execve.c @@ -16,8 +16,9 @@ static inline _syscall3(int, __syscall_execve, const char *, filename, char *const *, argv, char *const *, envp); -int attribute_hidden __execve(const char * filename, char *const * argv, char *const * envp) +int execve(const char * filename, char *const * argv, char *const * envp) { return __syscall_execve(filename, argv, envp); } -strong_alias(__execve,execve) +libc_hidden_proto(execve) +libc_hidden_def(execve) diff --git a/libc/sysdeps/linux/common/fchdir.c b/libc/sysdeps/linux/common/fchdir.c index f4692cc2c..3da6e1d58 100644 --- a/libc/sysdeps/linux/common/fchdir.c +++ b/libc/sysdeps/linux/common/fchdir.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___fchdir __NR_fchdir -attribute_hidden _syscall1(int, __fchdir, int, fd); -strong_alias(__fchdir,fchdir) +_syscall1(int, fchdir, int, fd); +libc_hidden_proto(fchdir) +libc_hidden_def(fchdir) diff --git a/libc/sysdeps/linux/common/fork.c b/libc/sysdeps/linux/common/fork.c index 899cbaf63..23c6fedff 100644 --- a/libc/sysdeps/linux/common/fork.c +++ b/libc/sysdeps/linux/common/fork.c @@ -12,9 +12,10 @@ #ifdef __ARCH_HAS_MMU__ #ifdef __NR_fork -#define __NR___fork __NR_fork -attribute_hidden _syscall0(pid_t, __fork); -strong_alias(__fork,fork) -weak_alias(__fork,__libc_fork) +#define __NR___libc_fork __NR_fork +_syscall0(pid_t, __libc_fork); +strong_alias(__libc_fork,fork) +libc_hidden_proto(fork) +libc_hidden_def(fork) #endif #endif diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c index af3f9a13b..0a8c81df6 100644 --- a/libc/sysdeps/linux/common/fstat.c +++ b/libc/sysdeps/linux/common/fstat.c @@ -10,7 +10,6 @@ /* need to hide the 64bit prototype or the weak_alias() * will fail when __NR_fstat64 doesnt exist */ #define fstat64 __hidefstat64 -#define __fstat64 __hide__fstat64 #include "syscalls.h" #include @@ -18,14 +17,12 @@ #include "xstatconv.h" #undef fstat64 -#undef __fstat64 #define __NR___syscall_fstat __NR_fstat -#undef __fstat #undef fstat static inline _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf); -int attribute_hidden __fstat(int fd, struct stat *buf) +int fstat(int fd, struct stat *buf) { int result; struct kernel_stat kbuf; @@ -36,9 +33,11 @@ int attribute_hidden __fstat(int fd, struct stat *buf) } return result; } -strong_alias(__fstat,fstat) +libc_hidden_proto(fstat) +libc_hidden_def(fstat) #if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__ -hidden_strong_alias(__fstat,__fstat64) -weak_alias(__fstat,fstat64) +strong_alias(fstat,fstat64) +libc_hidden_proto(fstat64) +libc_hidden_def(fstat64) #endif diff --git a/libc/sysdeps/linux/common/fstat64.c b/libc/sysdeps/linux/common/fstat64.c index 0d8bbdb43..fc91cbaf9 100644 --- a/libc/sysdeps/linux/common/fstat64.c +++ b/libc/sysdeps/linux/common/fstat64.c @@ -18,8 +18,7 @@ static inline _syscall2(int, __syscall_fstat64, int, filedes, struct kernel_stat64 *, buf); -#undef fstat64 -int attribute_hidden __fstat64(int fd, struct stat64 *buf) +int fstat64(int fd, struct stat64 *buf) { int result; struct kernel_stat64 kbuf; @@ -30,6 +29,7 @@ int attribute_hidden __fstat64(int fd, struct stat64 *buf) } return result; } -strong_alias(__fstat64,fstat64) +libc_hidden_proto(fstat64) +libc_hidden_def(fstat64) #endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/fstatfs.c b/libc/sysdeps/linux/common/fstatfs.c index 9a7cf303b..c88162e6d 100644 --- a/libc/sysdeps/linux/common/fstatfs.c +++ b/libc/sysdeps/linux/common/fstatfs.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___fstatfs __NR_fstatfs -attribute_hidden _syscall2(int, __fstatfs, int, fd, struct statfs *, buf); -strong_alias(__fstatfs,fstatfs) +_syscall2(int, fstatfs, int, fd, struct statfs *, buf); +libc_hidden_proto(fstatfs) +libc_hidden_def(fstatfs) diff --git a/libc/sysdeps/linux/common/fsync.c b/libc/sysdeps/linux/common/fsync.c index e6f610751..ab382bd87 100644 --- a/libc/sysdeps/linux/common/fsync.c +++ b/libc/sysdeps/linux/common/fsync.c @@ -12,4 +12,4 @@ #define __NR___libc_fsync __NR_fsync _syscall1(int, __libc_fsync, int, fd); -weak_alias(__libc_fsync, fsync) +strong_alias(__libc_fsync, fsync) diff --git a/libc/sysdeps/linux/common/ftruncate.c b/libc/sysdeps/linux/common/ftruncate.c index a25fd0285..1d4e62d26 100644 --- a/libc/sysdeps/linux/common/ftruncate.c +++ b/libc/sysdeps/linux/common/ftruncate.c @@ -10,4 +10,5 @@ #include "syscalls.h" #include _syscall2(int, ftruncate, int, fd, __off_t, length); -hidden_strong_alias(ftruncate, __ftruncate) +libc_hidden_proto(ftruncate) +libc_hidden_def(ftruncate) diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c index 51392a1aa..5516f3b6f 100644 --- a/libc/sysdeps/linux/common/ftruncate64.c +++ b/libc/sysdeps/linux/common/ftruncate64.c @@ -12,8 +12,6 @@ * the main directory of this archive for more details. */ -#define ftruncate __ftruncate - #include #include #include @@ -65,6 +63,8 @@ int ftruncate64 (int fd, __off64_t length) #else /* __NR_ftruncate64 */ +libc_hidden_proto(ftruncate) + int ftruncate64 (int fd, __off64_t length) { __off_t x = (__off_t) length; diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index a44647d67..63b195ec2 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -1,8 +1,10 @@ -/* These functions find the absolute path to the current working directory. */ +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ -#define opendir __opendir -#define closedir __closedir -#define readdir __readdir +/* These functions find the absolute path to the current working directory. */ #include #include @@ -11,6 +13,15 @@ #include #include +libc_hidden_proto(strcat) +libc_hidden_proto(strcpy) +libc_hidden_proto(strncpy) +libc_hidden_proto(strlen) +libc_hidden_proto(opendir) +libc_hidden_proto(readdir) +libc_hidden_proto(closedir) +libc_hidden_proto(stat) + #ifdef __NR_getcwd #define __NR___syscall_getcwd __NR_getcwd @@ -43,7 +54,7 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path int slow_search = (sizeof(ino_t) != sizeof(d->d_ino)); #endif - if (__stat(path_buf, &st) < 0) { + if (stat(path_buf, &st) < 0) { goto oops; } #ifdef FAST_DIR_SEARCH_POSSIBLE @@ -51,13 +62,13 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path slow_search = 1; #endif - slen = __strlen(path_buf); + slen = strlen(path_buf); ptr = path_buf + slen - 1; if (*ptr != '/') { if (slen + 2 > path_size) { goto oops; } - __strcpy(++ptr, "/"); + strcpy(++ptr, "/"); slen++; } slen++; @@ -71,11 +82,11 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path #ifdef FAST_DIR_SEARCH_POSSIBLE if (slow_search || this_ino == d->d_ino) { #endif - if (slen + __strlen(d->d_name) > path_size) { + if (slen + strlen(d->d_name) > path_size) { goto oops; } - __strcpy(ptr + 1, d->d_name); - if (__stat(path_buf, &st) < 0) + strcpy(ptr + 1, d->d_name); + if (stat(path_buf, &st) < 0) continue; if (st.st_ino == this_ino && st.st_dev == this_dev) { closedir(dp); @@ -101,7 +112,7 @@ static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ dev_t this_dev; ino_t this_ino; - if (__stat(path_buf, &st) < 0) { + if (stat(path_buf, &st) < 0) { if (errno != EFAULT) goto oops; return 0; @@ -112,13 +123,13 @@ static char *recurser(char *path_buf, int path_size, dev_t root_dev, ino_t root_ if (path_size < 2) { goto oops; } - __strcpy(path_buf, "/"); + strcpy(path_buf, "/"); return path_buf; } - if (__strlen(path_buf) + 4 > path_size) { + if (strlen(path_buf) + 4 > path_size) { goto oops; } - __strcat(path_buf, "/.."); + strcat(path_buf, "/.."); if (recurser(path_buf, path_size, root_dev, root_ino) == 0) return 0; @@ -140,16 +151,16 @@ int __syscall_getcwd(char * buf, unsigned long size) len = -1; /* get stat for root to have a valid parameters for the terminating condition */ - if (__stat("/", &st) < 0) { + if (stat("/", &st) < 0) { /* root dir not found! */ return -1; } /* start with actual dir */ - if (buf) __strncpy(buf, ".", size); + if (buf) strncpy(buf, ".", size); cwd = recurser(buf, size, st.st_dev, st.st_ino); if (cwd) { - len = __strlen(buf); + len = strlen(buf); __set_errno(olderrno); } return len; @@ -157,7 +168,7 @@ int __syscall_getcwd(char * buf, unsigned long size) #endif -char attribute_hidden *__getcwd(char *buf, size_t size) +char *getcwd(char *buf, size_t size) { int ret; char *path; @@ -189,4 +200,5 @@ char attribute_hidden *__getcwd(char *buf, size_t size) free (path); return NULL; } -strong_alias(__getcwd,getcwd) +libc_hidden_proto(getcwd) +libc_hidden_def(getcwd) diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c index 4db513a62..4b85d2c62 100644 --- a/libc/sysdeps/linux/common/getdents.c +++ b/libc/sysdeps/linux/common/getdents.c @@ -28,6 +28,9 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(lseek) + #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif @@ -75,7 +78,7 @@ ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes) /* Our heuristic failed. We read too many entries. Reset the stream. */ assert (last_offset != -1); - __lseek(fd, last_offset, SEEK_SET); + lseek(fd, last_offset, SEEK_SET); if ((char *) dp == buf) { /* The buffer the user passed in is too small to hold even @@ -91,7 +94,7 @@ ssize_t attribute_hidden __getdents (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - __memcpy (dp->d_name, kdp->d_name, + memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent, d_name)); dp = (struct dirent *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen); diff --git a/libc/sysdeps/linux/common/getdents64.c b/libc/sysdeps/linux/common/getdents64.c index f65e9e70b..c734fbbb6 100644 --- a/libc/sysdeps/linux/common/getdents64.c +++ b/libc/sysdeps/linux/common/getdents64.c @@ -29,6 +29,9 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(lseek64) + #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 #ifndef offsetof @@ -80,7 +83,7 @@ ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes) /* Our heuristic failed. We read too many entries. Reset the stream. */ assert (last_offset != -1); - __lseek64(fd, last_offset, SEEK_SET); + lseek64(fd, last_offset, SEEK_SET); if ((char *) dp == buf) { /* The buffer the user passed in is too small to hold even @@ -96,7 +99,7 @@ ssize_t attribute_hidden __getdents64 (int fd, char *buf, size_t nbytes) dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; - __memcpy (dp->d_name, kdp->d_name, + memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent64, d_name)); dp = (struct dirent64 *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent64 *) (((char *) kdp) + kdp->d_reclen); diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index a4285322b..3b470db05 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -17,14 +17,18 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define getcwd __getcwd - #include #include #include #include #include +libc_hidden_proto(strdup) +libc_hidden_proto(getcwd) +libc_hidden_proto(getenv) +libc_hidden_proto(stat) +libc_hidden_proto(stat64) + /* Return a malloc'd string containing the current directory name. If the environment variable `PWD' is set, and its value is correct, that value is used. */ @@ -39,19 +43,19 @@ get_current_dir_name (void) struct stat dotstat, pwdstat; #endif - pwd = __getenv ("PWD"); + pwd = getenv ("PWD"); if (pwd != NULL #if defined __UCLIBC_HAS_LFS__ - && __stat64 (".", &dotstat) == 0 - && __stat64 (pwd, &pwdstat) == 0 + && stat64 (".", &dotstat) == 0 + && stat64 (pwd, &pwdstat) == 0 #else - && __stat (".", &dotstat) == 0 - && __stat (pwd, &pwdstat) == 0 + && stat (".", &dotstat) == 0 + && stat (pwd, &pwdstat) == 0 #endif && pwdstat.st_dev == dotstat.st_dev && pwdstat.st_ino == dotstat.st_ino) /* The PWD value is correct. Use it. */ - return __strdup (pwd); + return strdup (pwd); return getcwd ((char *) NULL, 0); } diff --git a/libc/sysdeps/linux/common/getdnnm.c b/libc/sysdeps/linux/common/getdnnm.c index aa4215f84..04077b197 100644 --- a/libc/sysdeps/linux/common/getdnnm.c +++ b/libc/sysdeps/linux/common/getdnnm.c @@ -1,4 +1,8 @@ -#define uname __uname +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include #include @@ -7,9 +11,12 @@ #define __USE_GNU #include +libc_hidden_proto(strlen) +libc_hidden_proto(strcpy) +libc_hidden_proto(uname) -int attribute_hidden -__getdomainname(char *name, size_t len) +int +getdomainname(char *name, size_t len) { struct utsname uts; @@ -20,11 +27,12 @@ __getdomainname(char *name, size_t len) if (uname(&uts) == -1) return -1; - if (__strlen(uts.domainname)+1 > len) { + if (strlen(uts.domainname)+1 > len) { __set_errno(EINVAL); return -1; } - __strcpy(name, uts.domainname); + strcpy(name, uts.domainname); return 0; } -strong_alias(__getdomainname,getdomainname) +libc_hidden_proto(getdomainname) +libc_hidden_def(getdomainname) diff --git a/libc/sysdeps/linux/common/getdtablesize.c b/libc/sysdeps/linux/common/getdtablesize.c index de3af63d7..4408273b7 100644 --- a/libc/sysdeps/linux/common/getdtablesize.c +++ b/libc/sysdeps/linux/common/getdtablesize.c @@ -16,18 +16,18 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define getrlimit __getrlimit - #include #include #include #include +libc_hidden_proto(getrlimit) + #define __LOCAL_OPEN_MAX 256 /* Return the maximum number of file descriptors the current process could possibly have. */ -int attribute_hidden __getdtablesize (void) +int getdtablesize (void) { struct rlimit ru; @@ -36,4 +36,5 @@ int attribute_hidden __getdtablesize (void) returns -1. */ return getrlimit (RLIMIT_NOFILE, &ru) < 0 ? __LOCAL_OPEN_MAX : ru.rlim_cur; } -strong_alias(__getdtablesize,getdtablesize) +libc_hidden_proto(getdtablesize) +libc_hidden_def(getdtablesize) diff --git a/libc/sysdeps/linux/common/getegid.c b/libc/sysdeps/linux/common/getegid.c index bed60f052..4379ddd0b 100644 --- a/libc/sysdeps/linux/common/getegid.c +++ b/libc/sysdeps/linux/common/getegid.c @@ -7,22 +7,23 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define getgid __getgid - #include "syscalls.h" #include #ifdef __NR_getegid #define __NR___syscall_getegid __NR_getegid static inline _syscall0(int, __syscall_getegid); -gid_t attribute_hidden __getegid(void) +gid_t getegid(void) { return (__syscall_getegid()); } #else -gid_t attribute_hidden __getegid(void) +libc_hidden_proto(getgid) + +gid_t getegid(void) { return (getgid()); } #endif -strong_alias(__getegid,getegid) +libc_hidden_proto(getegid) +libc_hidden_def(getegid) diff --git a/libc/sysdeps/linux/common/geteuid.c b/libc/sysdeps/linux/common/geteuid.c index 3936739b3..c267d1483 100644 --- a/libc/sysdeps/linux/common/geteuid.c +++ b/libc/sysdeps/linux/common/geteuid.c @@ -7,22 +7,23 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define getuid __getuid - #include "syscalls.h" #include #ifdef __NR_geteuid #define __NR___syscall_geteuid __NR_geteuid static inline _syscall0(int, __syscall_geteuid); -uid_t attribute_hidden __geteuid(void) +uid_t geteuid(void) { return (__syscall_geteuid()); } #else -uid_t attribute_hidden __geteuid(void) +libc_hidden_proto(getuid) + +uid_t geteuid(void) { return (getuid()); } #endif -strong_alias(__geteuid,geteuid) +libc_hidden_proto(geteuid) +libc_hidden_def(geteuid) diff --git a/libc/sysdeps/linux/common/getgid.c b/libc/sysdeps/linux/common/getgid.c index eba29afa2..48c9af17c 100644 --- a/libc/sysdeps/linux/common/getgid.c +++ b/libc/sysdeps/linux/common/getgid.c @@ -16,8 +16,9 @@ #endif static inline _syscall0(int, __syscall_getgid); -gid_t attribute_hidden __getgid(void) +gid_t getgid(void) { return (__syscall_getgid()); } -strong_alias(__getgid,getgid) +libc_hidden_proto(getgid) +libc_hidden_def(getgid) diff --git a/libc/sysdeps/linux/common/getgroups.c b/libc/sysdeps/linux/common/getgroups.c index 83d92627e..081f001f1 100644 --- a/libc/sysdeps/linux/common/getgroups.c +++ b/libc/sysdeps/linux/common/getgroups.c @@ -7,20 +7,20 @@ * GNU Library General Public License (LGPL) version 2 or later. */ -#define sysconf __sysconf - #include "syscalls.h" #include #include #include +libc_hidden_proto(sysconf) + #define MIN(a,b) (((a)<(b))?(a):(b)) #define __NR___syscall_getgroups __NR_getgroups static inline _syscall2(int, __syscall_getgroups, int, size, __kernel_gid_t *, list); -int attribute_hidden __getgroups(int size, gid_t groups[]) +int getgroups(int size, gid_t groups[]) { if (unlikely(size < 0)) { ret_error: @@ -47,4 +47,5 @@ ret_error: return ngids; } } -strong_alias(__getgroups,getgroups) +libc_hidden_proto(getgroups) +libc_hidden_def(getgroups) diff --git a/libc/sysdeps/linux/common/gethstnm.c b/libc/sysdeps/linux/common/gethstnm.c index cb6e5efce..c932d239c 100644 --- a/libc/sysdeps/linux/common/gethstnm.c +++ b/libc/sysdeps/linux/common/gethstnm.c @@ -1,12 +1,20 @@ -#define uname __uname +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include #include #include #include -int attribute_hidden -__gethostname(char *name, size_t len) +libc_hidden_proto(strlen) +libc_hidden_proto(strcpy) +libc_hidden_proto(uname) + +int +gethostname(char *name, size_t len) { struct utsname uts; @@ -17,11 +25,12 @@ __gethostname(char *name, size_t len) if (uname(&uts) == -1) return -1; - if (__strlen(uts.nodename)+1 > len) { + if (strlen(uts.nodename)+1 > len) { __set_errno(EINVAL); return -1; } - __strcpy(name, uts.nodename); + strcpy(name, uts.nodename); return 0; } -strong_alias(__gethostname,gethostname) +libc_hidden_proto(gethostname) +libc_hidden_def(gethostname) diff --git a/libc/sysdeps/linux/common/getpagesize.c b/libc/sysdeps/linux/common/getpagesize.c index 517040d46..44456c0e7 100644 --- a/libc/sysdeps/linux/common/getpagesize.c +++ b/libc/sysdeps/linux/common/getpagesize.c @@ -19,14 +19,16 @@ #include #include #include -extern size_t __pagesize_internal attribute_hidden; + +extern size_t __pagesize; +libc_hidden_proto(__pagesize) /* Return the system page size. */ /* couldn't make __getpagesize hidden, because shm.h uses it in a macro */ -int attribute_hidden __getpagesize_internal(void) +int __getpagesize(void) { - if (__pagesize_internal != 0) - return __pagesize_internal; + if (__pagesize != 0) + return __pagesize; #ifdef EXEC_PAGESIZE return EXEC_PAGESIZE; @@ -41,6 +43,6 @@ int attribute_hidden __getpagesize_internal(void) #endif /* NBPG. */ #endif /* EXEC_PAGESIZE. */ } -strong_alias(__getpagesize_internal, __getpagesize) -weak_alias(__getpagesize_internal, getpagesize) - +strong_alias(__getpagesize,getpagesize) +libc_hidden_proto(getpagesize) +libc_hidden_def(getpagesize) diff --git a/libc/sysdeps/linux/common/getpgid.c b/libc/sysdeps/linux/common/getpgid.c index 8de8516dc..adb8beb06 100644 --- a/libc/sysdeps/linux/common/getpgid.c +++ b/libc/sysdeps/linux/common/getpgid.c @@ -12,8 +12,7 @@ #define __NR___syscall_getpgid __NR_getpgid static inline _syscall1(__kernel_pid_t, __syscall_getpgid, __kernel_pid_t, pid); -pid_t __getpgid(pid_t pid) +pid_t getpgid(pid_t pid) { return (__syscall_getpgid(pid)); } -weak_alias(__getpgid, getpgid) diff --git a/libc/sysdeps/linux/common/getpid.c b/libc/sysdeps/linux/common/getpid.c index 6a6a9e129..ecb29851e 100644 --- a/libc/sysdeps/linux/common/getpid.c +++ b/libc/sysdeps/linux/common/getpid.c @@ -11,10 +11,10 @@ #include #if defined (__alpha__) -#define __NR___getpid __NR_getxpid +#define __NR_getpid __NR_getxpid #endif -#define __NR___getpid __NR_getpid -attribute_hidden _syscall0(pid_t, __getpid); -strong_alias(__getpid, getpid) -/* not used in libpthread */ -/* weak_alias(__getpid, __libc_getpid) */ +#define __NR___libc_getpid __NR_getpid +_syscall0(pid_t, __libc_getpid); +strong_alias(__libc_getpid, getpid) +libc_hidden_proto(getpid) +libc_hidden_def(getpid) diff --git a/libc/sysdeps/linux/common/getpriority.c b/libc/sysdeps/linux/common/getpriority.c index 3f695402d..bde7a3d85 100644 --- a/libc/sysdeps/linux/common/getpriority.c +++ b/libc/sysdeps/linux/common/getpriority.c @@ -17,7 +17,7 @@ static inline _syscall2(int, __syscall_getpriority, /* The return value of __syscall_getpriority is biased by this value * to avoid returning negative values. */ #define PZERO 20 -int attribute_hidden __getpriority(enum __priority_which which, id_t who) +int getpriority(enum __priority_which which, id_t who) { int res; @@ -26,4 +26,5 @@ int attribute_hidden __getpriority(enum __priority_which which, id_t who) res = PZERO - res; return res; } -strong_alias(__getpriority,getpriority) +libc_hidden_proto(getpriority) +libc_hidden_def(getpriority) diff --git a/libc/sysdeps/linux/common/getrlimit.c b/libc/sysdeps/linux/common/getrlimit.c index fef907a03..804410b34 100644 --- a/libc/sysdeps/linux/common/getrlimit.c +++ b/libc/sysdeps/linux/common/getrlimit.c @@ -16,7 +16,7 @@ static inline _syscall2(int, __ugetrlimit, enum __rlimit_resource, resource, struct rlimit *, rlim); -int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) +int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { return (__ugetrlimit(resource, rlimits)); } @@ -28,7 +28,7 @@ int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rl static inline _syscall2(int, __syscall_getrlimit, int, resource, struct rlimit *, rlim); -int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) +int getrlimit(__rlimit_resource_t resource, struct rlimit *rlimits) { int result; @@ -47,4 +47,5 @@ int attribute_hidden __getrlimit(__rlimit_resource_t resource, struct rlimit *rl } #endif -strong_alias(__getrlimit,getrlimit) +libc_hidden_proto(getrlimit) +libc_hidden_def(getrlimit) diff --git a/libc/sysdeps/linux/common/getrlimit64.c b/libc/sysdeps/linux/common/getrlimit64.c index 76c3196ad..6f670c001 100644 --- a/libc/sysdeps/linux/common/getrlimit64.c +++ b/libc/sysdeps/linux/common/getrlimit64.c @@ -16,8 +16,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define getrlimit __getrlimit - #include #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 @@ -36,6 +34,8 @@ #include #include +libc_hidden_proto(getrlimit) + #if defined __UCLIBC_HAS_LFS__ /* Put the soft and hard limits for RESOURCE in *RLIMITS. diff --git a/libc/sysdeps/linux/common/getsid.c b/libc/sysdeps/linux/common/getsid.c index 3e9c2d8ba..91d327098 100644 --- a/libc/sysdeps/linux/common/getsid.c +++ b/libc/sysdeps/linux/common/getsid.c @@ -13,8 +13,9 @@ #define __NR___syscall_getsid __NR_getsid static inline _syscall1(__kernel_pid_t, __syscall_getsid, __kernel_pid_t, pid); -pid_t attribute_hidden __getsid(pid_t pid) +pid_t getsid(pid_t pid) { return (__syscall_getsid(pid)); } -strong_alias(__getsid,getsid) +libc_hidden_proto(getsid) +libc_hidden_def(getsid) diff --git a/libc/sysdeps/linux/common/gettimeofday.c b/libc/sysdeps/linux/common/gettimeofday.c index 6c2613f01..175691f89 100644 --- a/libc/sysdeps/linux/common/gettimeofday.c +++ b/libc/sysdeps/linux/common/gettimeofday.c @@ -9,6 +9,6 @@ #include "syscalls.h" #include -#define __NR___gettimeofday __NR_gettimeofday -attribute_hidden _syscall2(int, __gettimeofday, struct timeval *, tv, struct timezone *, tz); -strong_alias(__gettimeofday,gettimeofday) +_syscall2(int, gettimeofday, struct timeval *, tv, struct timezone *, tz); +libc_hidden_proto(gettimeofday) +libc_hidden_def(gettimeofday) diff --git a/libc/sysdeps/linux/common/getuid.c b/libc/sysdeps/linux/common/getuid.c index 7c81ccf48..610c34edc 100644 --- a/libc/sysdeps/linux/common/getuid.c +++ b/libc/sysdeps/linux/common/getuid.c @@ -17,8 +17,9 @@ static inline _syscall0(int, __syscall_getuid); -uid_t attribute_hidden __getuid(void) +uid_t getuid(void) { return (__syscall_getuid()); } -strong_alias(__getuid,getuid) +libc_hidden_proto(getuid) +libc_hidden_def(getuid) diff --git a/libc/sysdeps/linux/common/ioctl.c b/libc/sysdeps/linux/common/ioctl.c index 29293f359..e9ea707ab 100644 --- a/libc/sysdeps/linux/common/ioctl.c +++ b/libc/sysdeps/linux/common/ioctl.c @@ -11,11 +11,13 @@ #include #include +libc_hidden_proto(ioctl) + #define __NR___syscall_ioctl __NR_ioctl static inline _syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg); -int attribute_hidden __ioctl(int fd, unsigned long int request, ...) +int ioctl(int fd, unsigned long int request, ...) { void *arg; va_list list; @@ -26,4 +28,4 @@ int attribute_hidden __ioctl(int fd, unsigned long int request, ...) va_end(list); return __syscall_ioctl(fd, request, arg); } -strong_alias(__ioctl,ioctl) +libc_hidden_def(ioctl) diff --git a/libc/sysdeps/linux/common/kill.c b/libc/sysdeps/linux/common/kill.c index 2d1d9ae8a..2a6bfce8e 100644 --- a/libc/sysdeps/linux/common/kill.c +++ b/libc/sysdeps/linux/common/kill.c @@ -14,8 +14,9 @@ #define __NR___syscall_kill __NR_kill static inline _syscall2(int, __syscall_kill, __kernel_pid_t, pid, int, sig); -int attribute_hidden __kill(pid_t pid, int sig) +int kill(pid_t pid, int sig) { return (__syscall_kill(pid, sig)); } -strong_alias(__kill,kill) +libc_hidden_proto(kill) +libc_hidden_def(kill) diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c index a2ffd6196..b48641a1a 100644 --- a/libc/sysdeps/linux/common/llseek.c +++ b/libc/sysdeps/linux/common/llseek.c @@ -33,7 +33,6 @@ #include #include -#undef lseek64 #if defined __NR__llseek && defined __UCLIBC_HAS_LFS__ #ifndef INLINE_SYSCALL @@ -43,20 +42,21 @@ static inline _syscall5(int, __syscall_llseek, int, fd, off_t, offset_hi, off_t, offset_lo, loff_t *, result, int, whence); #endif -loff_t attribute_hidden __lseek64(int fd, loff_t offset, int whence) +loff_t __libc_lseek64(int fd, loff_t offset, int whence) { loff_t result; return(loff_t)(INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32), (off_t) (offset & 0xffffffff), &result, whence) ?: result); } #else -extern __off_t __lseek(int fildes, off_t offset, int whence) attribute_hidden; -loff_t __lseek64(int fd, loff_t offset, int whence) +extern __off_t __libc_lseek(int fildes, off_t offset, int whence); +libc_hidden_proto(__libc_lseek) +loff_t __libc_lseek64(int fd, loff_t offset, int whence) { - return(loff_t)(__lseek(fd, (off_t) (offset), whence)); + return(loff_t)(__libc_lseek(fd, (off_t) (offset), whence)); } #endif -strong_alias(__lseek64,lseek64) -//strong_alias(__lseek64,_llseek) -//strong_alias(__lseek64,llseek) -weak_alias(__lseek64,__libc_lseek64) +strong_alias(__libc_lseek64,lseek64) +libc_hidden_proto(lseek64) +libc_hidden_def(lseek64) +//strong_alias(__libc_lseek64,_llseek) diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index 5b4eff5f5..b2fdde9c9 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -20,9 +20,10 @@ #include #include +libc_hidden_proto(sigprocmask) extern void __longjmp (__jmp_buf __env, int val); - +libc_hidden_proto(__longjmp) /* Set the signal mask to the one specified in ENV, and jump to the position specified in ENV, causing the setjmp @@ -36,14 +37,14 @@ void __libc_longjmp (sigjmp_buf env, int val) if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ - (void) __sigprocmask (SIG_SETMASK, &env[0].__saved_mask, + (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, (sigset_t *) NULL); /* Call the machine-dependent function to restore machine state. */ __longjmp (env[0].__jmpbuf, val ?: 1); } -weak_alias (__libc_longjmp, longjmp) -weak_alias (__libc_l