summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/sysdeps
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/alpha/__longjmp.S1
-rw-r--r--libc/sysdeps/linux/alpha/brk.S12
-rw-r--r--libc/sysdeps/linux/alpha/clone.S14
-rw-r--r--libc/sysdeps/linux/arm/__longjmp.S1
-rw-r--r--libc/sysdeps/linux/arm/brk.c4
-rw-r--r--libc/sysdeps/linux/arm/clone.S13
-rw-r--r--libc/sysdeps/linux/arm/ioperm.c26
-rw-r--r--libc/sysdeps/linux/arm/iopl.c2
-rw-r--r--libc/sysdeps/linux/arm/mmap64.S2
-rw-r--r--libc/sysdeps/linux/arm/sigaction.c14
-rw-r--r--libc/sysdeps/linux/arm/vfork.S11
-rw-r--r--libc/sysdeps/linux/bfin/brk.c10
-rw-r--r--libc/sysdeps/linux/bfin/vfork.S3
-rw-r--r--libc/sysdeps/linux/common/__rt_sigtimedwait.c15
-rw-r--r--libc/sysdeps/linux/common/__syscall_fcntl.c25
-rw-r--r--libc/sysdeps/linux/common/__syscall_fcntl64.c11
-rw-r--r--libc/sysdeps/linux/common/_exit.c7
-rw-r--r--libc/sysdeps/linux/common/adjtimex.c9
-rw-r--r--libc/sysdeps/linux/common/alarm.c12
-rw-r--r--libc/sysdeps/linux/common/chdir.c5
-rw-r--r--libc/sysdeps/linux/common/chmod.c5
-rw-r--r--libc/sysdeps/linux/common/clock_getres.c4
-rw-r--r--libc/sysdeps/linux/common/clock_gettime.c4
-rw-r--r--libc/sysdeps/linux/common/clock_settime.c4
-rw-r--r--libc/sysdeps/linux/common/close.c9
-rw-r--r--libc/sysdeps/linux/common/cmsg_nxthdr.c7
-rw-r--r--libc/sysdeps/linux/common/creat64.c4
-rw-r--r--libc/sysdeps/linux/common/dl-osinfo.h13
-rw-r--r--libc/sysdeps/linux/common/dup2.c6
-rw-r--r--libc/sysdeps/linux/common/execve.c5
-rw-r--r--libc/sysdeps/linux/common/fchdir.c6
-rw-r--r--libc/sysdeps/linux/common/fork.c9
-rw-r--r--libc/sysdeps/linux/common/fstat.c13
-rw-r--r--libc/sysdeps/linux/common/fstat64.c6
-rw-r--r--libc/sysdeps/linux/common/fstatfs.c6
-rw-r--r--libc/sysdeps/linux/common/fsync.c2
-rw-r--r--libc/sysdeps/linux/common/ftruncate.c3
-rw-r--r--libc/sysdeps/linux/common/ftruncate64.c4
-rw-r--r--libc/sysdeps/linux/common/getcwd.c50
-rw-r--r--libc/sysdeps/linux/common/getdents.c7
-rw-r--r--libc/sysdeps/linux/common/getdents64.c7
-rw-r--r--libc/sysdeps/linux/common/getdirname.c20
-rw-r--r--libc/sysdeps/linux/common/getdnnm.c20
-rw-r--r--libc/sysdeps/linux/common/getdtablesize.c9
-rw-r--r--libc/sysdeps/linux/common/getegid.c11
-rw-r--r--libc/sysdeps/linux/common/geteuid.c11
-rw-r--r--libc/sysdeps/linux/common/getgid.c5
-rw-r--r--libc/sysdeps/linux/common/getgroups.c9
-rw-r--r--libc/sysdeps/linux/common/gethstnm.c21
-rw-r--r--libc/sysdeps/linux/common/getpagesize.c16
-rw-r--r--libc/sysdeps/linux/common/getpgid.c3
-rw-r--r--libc/sysdeps/linux/common/getpid.c12
-rw-r--r--libc/sysdeps/linux/common/getpriority.c5
-rw-r--r--libc/sysdeps/linux/common/getrlimit.c7
-rw-r--r--libc/sysdeps/linux/common/getrlimit64.c4
-rw-r--r--libc/sysdeps/linux/common/getsid.c5
-rw-r--r--libc/sysdeps/linux/common/gettimeofday.c6
-rw-r--r--libc/sysdeps/linux/common/getuid.c5
-rw-r--r--libc/sysdeps/linux/common/ioctl.c6
-rw-r--r--libc/sysdeps/linux/common/kill.c5
-rw-r--r--libc/sysdeps/linux/common/llseek.c18
-rw-r--r--libc/sysdeps/linux/common/longjmp.c13
-rw-r--r--libc/sysdeps/linux/common/lseek.c14
-rw-r--r--libc/sysdeps/linux/common/lstat.c13
-rw-r--r--libc/sysdeps/linux/common/lstat64.c6
-rw-r--r--libc/sysdeps/linux/common/mkdir.c5
-rw-r--r--libc/sysdeps/linux/common/mkfifo.c4
-rw-r--r--libc/sysdeps/linux/common/mknod.c5
-rw-r--r--libc/sysdeps/linux/common/mmap.c5
-rw-r--r--libc/sysdeps/linux/common/mmap64.c5
-rw-r--r--libc/sysdeps/linux/common/modify_ldt.c2
-rw-r--r--libc/sysdeps/linux/common/mremap.c6
-rw-r--r--libc/sysdeps/linux/common/msync.c2
-rw-r--r--libc/sysdeps/linux/common/munmap.c6
-rw-r--r--libc/sysdeps/linux/common/nanosleep.c5
-rw-r--r--libc/sysdeps/linux/common/nice.c7
-rw-r--r--libc/sysdeps/linux/common/ntp_gettime.c6
-rw-r--r--libc/sysdeps/linux/common/open.c14
-rw-r--r--libc/sysdeps/linux/common/open64.c14
-rw-r--r--libc/sysdeps/linux/common/pause.c8
-rw-r--r--libc/sysdeps/linux/common/pipe.c6
-rw-r--r--libc/sysdeps/linux/common/poll.c46
-rw-r--r--libc/sysdeps/linux/common/posix_fadvise.c6
-rw-r--r--libc/sysdeps/linux/common/posix_fadvise64.c2
-rw-r--r--libc/sysdeps/linux/common/pread_write.c35
-rw-r--r--libc/sysdeps/linux/common/read.c9
-rw-r--r--libc/sysdeps/linux/common/readlink.c6
-rw-r--r--libc/sysdeps/linux/common/rmdir.c6
-rw-r--r--libc/sysdeps/linux/common/sbrk.c12
-rw-r--r--libc/sysdeps/linux/common/select.c10
-rw-r--r--libc/sysdeps/linux/common/setegid.c10
-rw-r--r--libc/sysdeps/linux/common/seteuid.c14
-rw-r--r--libc/sysdeps/linux/common/setgroups.c9
-rw-r--r--libc/sysdeps/linux/common/setitimer.c6
-rw-r--r--libc/sysdeps/linux/common/setpgid.c5
-rw-r--r--libc/sysdeps/linux/common/setpgrp.c8
-rw-r--r--libc/sysdeps/linux/common/setpriority.c6
-rw-r--r--libc/sysdeps/linux/common/setregid.c4
-rw-r--r--libc/sysdeps/linux/common/setresgid.c5
-rw-r--r--libc/sysdeps/linux/common/setresuid.c5
-rw-r--r--libc/sysdeps/linux/common/setreuid.c5
-rw-r--r--libc/sysdeps/linux/common/setrlimit.c8
-rw-r--r--libc/sysdeps/linux/common/setrlimit64.c4
-rw-r--r--libc/sysdeps/linux/common/setsid.c6
-rw-r--r--libc/sysdeps/linux/common/settimeofday.c6
-rw-r--r--libc/sysdeps/linux/common/sigprocmask.c7
-rw-r--r--libc/sysdeps/linux/common/sigsuspend.c7
-rw-r--r--libc/sysdeps/linux/common/ssp.c38
-rw-r--r--libc/sysdeps/linux/common/stat.c13
-rw-r--r--libc/sysdeps/linux/common/stat64.c6
-rw-r--r--libc/sysdeps/linux/common/statfs.c5
-rw-r--r--libc/sysdeps/linux/common/time.c12
-rw-r--r--libc/sysdeps/linux/common/times.c6
-rw-r--r--libc/sysdeps/linux/common/truncate.c3
-rw-r--r--libc/sysdeps/linux/common/truncate64.c5
-rw-r--r--libc/sysdeps/linux/common/ulimit.c8
-rw-r--r--libc/sysdeps/linux/common/uname.c6
-rw-r--r--libc/sysdeps/linux/common/unlink.c6
-rw-r--r--libc/sysdeps/linux/common/utime.c15
-rw-r--r--libc/sysdeps/linux/common/utimes.c13
-rw-r--r--libc/sysdeps/linux/common/vfork.c9
-rw-r--r--libc/sysdeps/linux/common/wait.c14
-rw-r--r--libc/sysdeps/linux/common/wait3.c7
-rw-r--r--libc/sysdeps/linux/common/wait4.c5
-rw-r--r--libc/sysdeps/linux/common/waitpid.c17
-rw-r--r--libc/sysdeps/linux/common/write.c11
-rw-r--r--libc/sysdeps/linux/cris/brk.c5
-rw-r--r--libc/sysdeps/linux/cris/clone.S9
-rw-r--r--libc/sysdeps/linux/cris/fork.c4
-rw-r--r--libc/sysdeps/linux/cris/sbrk.c7
-rw-r--r--libc/sysdeps/linux/cris/setjmp.S9
-rw-r--r--libc/sysdeps/linux/e1/longjmp.c4
-rw-r--r--libc/sysdeps/linux/frv/brk.c5
-rw-r--r--libc/sysdeps/linux/frv/clone.S13
-rw-r--r--libc/sysdeps/linux/frv/fstat.c6
-rw-r--r--libc/sysdeps/linux/frv/fstat64.c6
-rw-r--r--libc/sysdeps/linux/frv/lstat.c6
-rw-r--r--libc/sysdeps/linux/frv/lstat64.c6
-rw-r--r--libc/sysdeps/linux/frv/mmap.c5
-rw-r--r--libc/sysdeps/linux/frv/sbrk.c7
-rw-r--r--libc/sysdeps/linux/frv/stat.c6
-rw-r--r--libc/sysdeps/linux/frv/stat64.c6
-rw-r--r--libc/sysdeps/linux/frv/vfork.S11
-rw-r--r--libc/sysdeps/linux/h8300/brk.c5
-rw-r--r--libc/sysdeps/linux/h8300/clone.S10
-rw-r--r--libc/sysdeps/linux/h8300/vfork.S1
-rw-r--r--libc/sysdeps/linux/hppa/__longjmp.S3
-rw-r--r--libc/sysdeps/linux/hppa/brk.c7
-rw-r--r--libc/sysdeps/linux/hppa/clone.S13
-rw-r--r--libc/sysdeps/linux/hppa/mmap.c6
-rw-r--r--libc/sysdeps/linux/i386/__longjmp.S3
-rw-r--r--libc/sysdeps/linux/i386/brk.c5
-rw-r--r--libc/sysdeps/linux/i386/clone.S11
-rw-r--r--libc/sysdeps/linux/i386/mmap.S13
-rw-r--r--libc/sysdeps/linux/i386/sigaction.c11
-rw-r--r--libc/sysdeps/linux/i386/vfork.S15
-rw-r--r--libc/sysdeps/linux/m68k/__longjmp.S1
-rw-r--r--libc/sysdeps/linux/m68k/brk.c5
-rw-r--r--libc/sysdeps/linux/m68k/clone.S13
-rw-r--r--libc/sysdeps/linux/m68k/vfork.S11
-rw-r--r--libc/sysdeps/linux/microblaze/__longjmp.S2
-rw-r--r--libc/sysdeps/linux/microblaze/longjmp.S2
-rw-r--r--libc/sysdeps/linux/microblaze/mmap.c2
-rw-r--r--libc/sysdeps/linux/microblaze/vfork.S7
-rw-r--r--libc/sysdeps/linux/mips/__longjmp.c2
-rw-r--r--libc/sysdeps/linux/mips/brk.c5
-rw-r--r--libc/sysdeps/linux/mips/clone.S13
-rw-r--r--libc/sysdeps/linux/mips/mmap.c6
-rw-r--r--libc/sysdeps/linux/mips/pipe.S11
-rw-r--r--libc/sysdeps/linux/mips/pipe.c3
-rw-r--r--libc/sysdeps/linux/mips/pread_write.c8
-rw-r--r--libc/sysdeps/linux/mips/sigaction.c11
-rw-r--r--libc/sysdeps/linux/nios/__longjmp.S8
-rw-r--r--libc/sysdeps/linux/nios/brk.c5
-rw-r--r--libc/sysdeps/linux/nios/clone.S11
-rw-r--r--libc/sysdeps/linux/nios/vfork.S10
-rw-r--r--libc/sysdeps/linux/nios2/__longjmp.S1
-rw-r--r--libc/sysdeps/linux/nios2/brk.c5
-rw-r--r--libc/sysdeps/linux/nios2/clone.S11
-rw-r--r--libc/sysdeps/linux/nios2/vfork.S11
-rw-r--r--libc/sysdeps/linux/powerpc/__longjmp.S2
-rw-r--r--libc/sysdeps/linux/powerpc/brk.S13
-rw-r--r--libc/sysdeps/linux/powerpc/clone.S12
-rw-r--r--libc/sysdeps/linux/powerpc/ioctl.c11
-rw-r--r--libc/sysdeps/linux/powerpc/mmap.c5
-rw-r--r--libc/sysdeps/linux/powerpc/pread_write.c35
-rw-r--r--libc/sysdeps/linux/powerpc/vfork.S15
-rw-r--r--libc/sysdeps/linux/powerpc/vfork.c5
-rw-r--r--libc/sysdeps/linux/sh/__longjmp.S3
-rw-r--r--libc/sysdeps/linux/sh/brk.c5
-rw-r--r--libc/sysdeps/linux/sh/clone.S13
-rw-r--r--libc/sysdeps/linux/sh/longjmp.c1
-rw-r--r--libc/sysdeps/linux/sh/mmap.c6
-rw-r--r--libc/sysdeps/linux/sh/pipe.c3
-rw-r--r--libc/sysdeps/linux/sh/pread_write.c8
-rw-r--r--libc/sysdeps/linux/sh/sbrk.c7
-rw-r--r--libc/sysdeps/linux/sh/vfork.S12
-rw-r--r--libc/sysdeps/linux/sh64/brk.c5
-rw-r--r--libc/sysdeps/linux/sparc/__longjmp.S3
-rw-r--r--libc/sysdeps/linux/sparc/brk.c5
-rw-r--r--libc/sysdeps/linux/sparc/clone.S14
-rw-r--r--libc/sysdeps/linux/sparc/fork.S13
-rw-r--r--libc/sysdeps/linux/sparc/vfork.S15
-rw-r--r--libc/sysdeps/linux/v850/__longjmp.S2
-rw-r--r--libc/sysdeps/linux/v850/mmap.c2
-rw-r--r--libc/sysdeps/linux/v850/vfork.S8
-rw-r--r--libc/sysdeps/linux/x86_64/__longjmp.S2
-rw-r--r--libc/sysdeps/linux/x86_64/brk.c5
-rw-r--r--libc/sysdeps/linux/x86_64/clone.S13
-rw-r--r--libc/sysdeps/linux/x86_64/mmap.c6
-rw-r--r--libc/sysdeps/linux/x86_64/sigaction.c14
-rw-r--r--libc/sysdeps/linux/x86_64/vfork.S15
212 files changed, 980 insertions, 841 deletions
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 <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -53,6 +47,18 @@
#include <asm/page.h>
#include <sys/sysctl.h>
+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 <linux/version.h>
#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 <sys/io.h>
#include <errno.h>
+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 <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <unistd.h>
#include <sys/syscall.h>
@@ -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 <features.h>
#include <asm/unistd.h>
.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 <stdarg.h>
#include <fcntl.h>
-#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 <fcntl.h>
#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 <sys/timex.h>
-#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 <unistd.h>
#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 <sys/time.h>
-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 <time.h>
@@ -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 <time.h>
@@ -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 <time.h>
@@ -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 <unistd.h>
-#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 <features.h>
#include <sys/socket.h>
-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 <features.h>
#include <fcntl.h>
#include <sys/types.h>
@@ -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 <features.h>
#ifdef __UCLIBC_HAS_SSP__
@@ -22,9 +20,14 @@
# include <sys/time.h>
# ifdef IS_IN_libc
-# define OPEN __open
-# define READ __read
-# define CLOSE __close
+#include <fcntl.h>
+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 <unistd.h>
-#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 <unistd.h>
-#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 <unistd.h>
@@ -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 <sys/vfs.h>
-#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 <unistd.h>
_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 <features.h>
#include <unistd.h>
#include <errno.h>
@@ -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 <andersen@uclibc.org>
+ *
+ * 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 <stdlib.h>
#include <errno.h>
@@ -11,6 +13,15 @@
#include <string.h>
#include <sys/syscall.h>
+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 <sys/types.h>
#include <sys/syscall.h>
+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 <sys/types.h>
#include <sys/syscall.h>
+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 <features.h>
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
+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 <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <stdlib.h>
#include <string.h>
@@ -7,9 +11,12 @@
#define __USE_GNU
#include <sys/utsname.h>
+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 <stdlib.h>
#include <unistd.h>
#include <sys/resource.h>
#include <limits.h>
+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 <unistd.h>
#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 <unistd.h>
#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 <stdlib.h>
#include <unistd.h>
#include <grp.h>
+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 <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <string.h>
#include <unistd.h>
#include <sys/utsname.h>
#include <errno.h>
-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 <unistd.h>
#include <features.h>
#include <sys/param.h>
-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 <unistd.h>
#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 <features.h>
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
@@ -36,6 +34,8 @@
#include <sys/types.h>
#include <sys/resource.h>
+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 <sys/time.h>
-#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 <stdarg.h>
#include <sys/ioctl.h>
+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 <sys/types.h>
#include <sys/syscall.h>
-#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 <setjmp.h>
#include <signal.h>
+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_longjmp, _longjmp)
-weak_alias (__libc_longjmp, siglongjmp)
-weak_alias (__libc_longjmp, __libc_siglongjmp)
+strong_alias(__libc_longjmp,longjmp)
+strong_alias(__libc_longjmp,siglongjmp)
+strong_alias(__libc_longjmp,__libc_siglongjmp)
+/* weak_alias (__libc_longjmp, _longjmp) */
diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c
index 4eb51d322..2ed5e4a14 100644
--- a/libc/sysdeps/linux/common/lseek.c
+++ b/libc/sysdeps/linux/common/lseek.c
@@ -10,9 +10,11 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___lseek __NR_lseek
-#undef __lseek
-#undef lseek
-attribute_hidden _syscall3(__off_t, __lseek, int, fildes, __off_t, offset, int, whence);
-strong_alias(__lseek,lseek)
-weak_alias(__lseek,__libc_lseek)
+#define __NR___libc_lseek __NR_lseek
+_syscall3(__off_t, __libc_lseek, int, fildes, __off_t, offset, int, whence);
+libc_hidden_proto(__libc_lseek)
+libc_hidden_def(__libc_lseek)
+
+strong_alias(__libc_lseek,lseek)
+libc_hidden_proto(lseek)
+libc_hidden_def(lseek)
diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c
index d7feac273..9509c489d 100644
--- a/libc/sysdeps/linux/common/lstat.c
+++ b/libc/sysdeps/linux/common/lstat.c
@@ -10,7 +10,6 @@
/* need to hide the 64bit prototype or the weak_alias()
* will fail when __NR_lstat64 doesnt exist */
#define lstat64 __hidelstat64
-#define __lstat64 __hide__lstat64
#include "syscalls.h"
#include <unistd.h>
@@ -18,15 +17,13 @@
#include "xstatconv.h"
#undef lstat64
-#undef __lstat64
#define __NR___syscall_lstat __NR_lstat
-#undef __lstat
#undef lstat
static inline _syscall2(int, __syscall_lstat,
const char *, file_name, struct kernel_stat *, buf);
-int attribute_hidden __lstat(const char *file_name, struct stat *buf)
+int lstat(const char *file_name, struct stat *buf)
{
int result;
struct kernel_stat kbuf;
@@ -37,9 +34,11 @@ int attribute_hidden __lstat(const char *file_name, struct stat *buf)
}
return result;
}
-strong_alias(__lstat,lstat)
+libc_hidden_proto(lstat)
+libc_hidden_def(lstat)
#if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__
-hidden_strong_alias(__lstat,__lstat64)
-weak_alias(lstat,lstat64)
+strong_alias(lstat,lstat64)
+libc_hidden_proto(lstat64)
+libc_hidden_def(lstat64)
#endif
diff --git a/libc/sysdeps/linux/common/lstat64.c b/libc/sysdeps/linux/common/lstat64.c
index 99b655a0c..b56184f82 100644
--- a/libc/sysdeps/linux/common/lstat64.c
+++ b/libc/sysdeps/linux/common/lstat64.c
@@ -15,11 +15,10 @@
#include "xstatconv.h"
#define __NR___syscall_lstat64 __NR_lstat64
-#undef lstat64
static inline _syscall2(int, __syscall_lstat64, const char *, file_name,
struct kernel_stat64 *, buf);
-int attribute_hidden __lstat64(const char *file_name, struct stat64 *buf)
+int lstat64(const char *file_name, struct stat64 *buf)
{
int result;
struct kernel_stat64 kbuf;
@@ -30,6 +29,7 @@ int attribute_hidden __lstat64(const char *file_name, struct stat64 *buf)
}
return result;
}
-strong_alias(__lstat64,lstat64)
+libc_hidden_proto(lstat64)
+libc_hidden_def(lstat64)
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/common/mkdir.c b/libc/sysdeps/linux/common/mkdir.c
index 5e96cf599..819793f87 100644
--- a/libc/sysdeps/linux/common/mkdir.c
+++ b/libc/sysdeps/linux/common/mkdir.c
@@ -14,8 +14,9 @@
static inline _syscall2(int, __syscall_mkdir, const char *, pathname,
__kernel_mode_t, mode);
-int attribute_hidden __mkdir(const char *pathname, mode_t mode)
+int mkdir(const char *pathname, mode_t mode)
{
return (__syscall_mkdir(pathname, mode));
}
-strong_alias(__mkdir,mkdir)
+libc_hidden_proto(mkdir)
+libc_hidden_def(mkdir)
diff --git a/libc/sysdeps/linux/common/mkfifo.c b/libc/sysdeps/linux/common/mkfifo.c
index db7f8fc42..dddfe8c7b 100644
--- a/libc/sysdeps/linux/common/mkfifo.c
+++ b/libc/sysdeps/linux/common/mkfifo.c
@@ -20,13 +20,13 @@
by Erik Andersen <andersee@debian.org>
*/
-#define mknod __mknod
-
#include <errno.h>
#include <stddef.h>
#include <sys/stat.h>
#include <sys/types.h>
+libc_hidden_proto(mknod)
+
/* Create a named pipe (FIFO) named PATH with protections MODE. */
int
mkfifo (const char *path, mode_t mode)
diff --git a/libc/sysdeps/linux/common/mknod.c b/libc/sysdeps/linux/common/mknod.c
index d66747178..f914af5d7 100644
--- a/libc/sysdeps/linux/common/mknod.c
+++ b/libc/sysdeps/linux/common/mknod.c
@@ -15,7 +15,7 @@
static inline _syscall3(int, __syscall_mknod, const char *, path,
__kernel_mode_t, mode, __kernel_dev_t, dev);
-int attribute_hidden __mknod(const char *path, mode_t mode, dev_t dev)
+int mknod(const char *path, mode_t mode, dev_t dev)
{
/* We must convert the dev_t value to a __kernel_dev_t */
__kernel_dev_t k_dev;
@@ -23,4 +23,5 @@ int attribute_hidden __mknod(const char *path, mode_t mode, dev_t dev)
k_dev = ((major(dev) & 0xff) << 8) | (minor(dev) & 0xff);
return __syscall_mknod(path, mode, k_dev);
}
-strong_alias(__mknod,mknod)
+libc_hidden_proto(mknod)
+libc_hidden_def(mknod)
diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c
index 3cd3eee4d..eadecfeee 100644
--- a/libc/sysdeps/linux/common/mmap.c
+++ b/libc/sysdeps/linux/common/mmap.c
@@ -14,7 +14,7 @@
#ifdef __NR_mmap
#define __NR__mmap __NR_mmap
static inline _syscall1(__ptr_t, _mmap, unsigned long *, buffer);
-attribute_hidden __ptr_t __mmap(__ptr_t addr, size_t len, int prot,
+__ptr_t mmap(__ptr_t addr, size_t len, int prot,
int flags, int fd, __off_t offset)
{
unsigned long buffer[6];
@@ -27,5 +27,6 @@ attribute_hidden __ptr_t __mmap(__ptr_t addr, size_t len, int prot,
buffer[5] = (unsigned long) offset;
return (__ptr_t) _mmap(buffer);
}
-strong_alias(__mmap,mmap)
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
#endif
diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c
index f0380b1ad..c0bc2b53a 100644
--- a/libc/sysdeps/linux/common/mmap64.c
+++ b/libc/sysdeps/linux/common/mmap64.c
@@ -19,14 +19,11 @@
/* Massivly hacked up for uClibc by Erik Andersen */
-#define mmap __mmap
-
#include <features.h>
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
-
#if defined __UCLIBC_HAS_LFS__
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
@@ -45,6 +42,8 @@
#if ! defined __NR_mmap2 || ! defined _syscall6
+libc_hidden_proto(mmap)
+
/*
* This version is a stub that just chops off everything at the mmap 32 bit
* mmap() address space... You will probably need to add in an arch specific
diff --git a/libc/sysdeps/linux/common/modify_ldt.c b/libc/sysdeps/linux/common/modify_ldt.c
index 618681ad3..47ed7e350 100644
--- a/libc/sysdeps/linux/common/modify_ldt.c
+++ b/libc/sysdeps/linux/common/modify_ldt.c
@@ -11,5 +11,5 @@
#ifdef __NR_modify_ldt
_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount);
-weak_alias(modify_ldt, __modify_ldt)
+/*weak_alias(modify_ldt, __modify_ldt)*/
#endif
diff --git a/libc/sysdeps/linux/common/mremap.c b/libc/sysdeps/linux/common/mremap.c
index f4a4670d2..16359193b 100644
--- a/libc/sysdeps/linux/common/mremap.c
+++ b/libc/sysdeps/linux/common/mremap.c
@@ -10,7 +10,7 @@
#include "syscalls.h"
#include <unistd.h>
#include <sys/mman.h>
-#define __NR___mremap __NR_mremap
-attribute_hidden _syscall4(__ptr_t, __mremap, __ptr_t, old_address, size_t, old_size, size_t,
+_syscall4(__ptr_t, mremap, __ptr_t, old_address, size_t, old_size, size_t,
new_size, int, may_move);
-strong_alias(__mremap,mremap)
+libc_hidden_proto(mremap)
+libc_hidden_def(mremap)
diff --git a/libc/sysdeps/linux/common/msync.c b/libc/sysdeps/linux/common/msync.c
index 8de9f346e..044652720 100644
--- a/libc/sysdeps/linux/common/msync.c
+++ b/libc/sysdeps/linux/common/msync.c
@@ -13,4 +13,4 @@
#define __NR___libc_msync __NR_msync
_syscall3(int, __libc_msync, void *, addr, size_t, length, int, flags);
-weak_alias(__libc_msync, msync)
+strong_alias(__libc_msync,msync)
diff --git a/libc/sysdeps/linux/common/munmap.c b/libc/sysdeps/linux/common/munmap.c
index be631060a..cd76eb297 100644
--- a/libc/sysdeps/linux/common/munmap.c
+++ b/libc/sysdeps/linux/common/munmap.c
@@ -10,6 +10,6 @@
#include "syscalls.h"
#include <unistd.h>
#include <sys/mman.h>
-#define __NR___munmap __NR_munmap
-attribute_hidden _syscall2(int, __munmap, void *, start, size_t, length);
-strong_alias(__munmap,munmap)
+_syscall2(int, munmap, void *, start, size_t, length);
+libc_hidden_proto(munmap)
+libc_hidden_def(munmap)
diff --git a/libc/sysdeps/linux/common/nanosleep.c b/libc/sysdeps/linux/common/nanosleep.c
index 3f5ffbaa3..0032f6623 100644
--- a/libc/sysdeps/linux/common/nanosleep.c
+++ b/libc/sysdeps/linux/common/nanosleep.c
@@ -13,5 +13,6 @@
#define __NR___libc_nanosleep __NR_nanosleep
_syscall2(int, __libc_nanosleep, const struct timespec *, req,
struct timespec *, rem);
-hidden_weak_alias(__libc_nanosleep,__nanosleep)
-weak_alias(__libc_nanosleep,nanosleep)
+strong_alias(__libc_nanosleep,nanosleep)
+libc_hidden_proto(nanosleep)
+libc_hidden_def(nanosleep)
diff --git a/libc/sysdeps/linux/common/nice.c b/libc/sysdeps/linux/common/nice.c
index 20f7996a7..75e065e65 100644
--- a/libc/sysdeps/linux/common/nice.c
+++ b/libc/sysdeps/linux/common/nice.c
@@ -8,13 +8,12 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-#define getpriority __getpriority
-#define setpriority __setpriority
-
#include "syscalls.h"
#include <unistd.h>
#include <sys/resource.h>
+libc_hidden_proto(getpriority)
+
#ifdef __NR_nice
#define __NR___syscall_nice __NR_nice
@@ -24,6 +23,8 @@ static inline _syscall1(int, __syscall_nice, int, incr);
#include <limits.h>
+libc_hidden_proto(setpriority)
+
static inline int int_add_no_wrap(int a, int b)
{
int s = a + b;
diff --git a/libc/sysdeps/linux/common/ntp_gettime.c b/libc/sysdeps/linux/common/ntp_gettime.c
index 0c4d1549f..f32e05444 100644
--- a/libc/sysdeps/linux/common/ntp_gettime.c
+++ b/libc/sysdeps/linux/common/ntp_gettime.c
@@ -16,17 +16,17 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define adjtimex __adjtimex
-
#include <sys/timex.h>
+libc_hidden_proto(adjtimex)
+
int ntp_gettime(struct ntptimeval *ntv)
{
struct timex tntx;
int result;
tntx.modes = 0;
- result = __adjtimex(&tntx);
+ result = adjtimex(&tntx);
ntv->time = tntx.time;
ntv->maxerror = tntx.maxerror;
ntv->esterror = tntx.esterror;
diff --git a/libc/sysdeps/linux/common/open.c b/libc/sysdeps/linux/common/open.c
index 648f7d053..14cf65750 100644
--- a/libc/sysdeps/linux/common/open.c
+++ b/libc/sysdeps/linux/common/open.c
@@ -14,13 +14,11 @@
#include <string.h>
#include <sys/param.h>
-#undef __open
-#undef open
#define __NR___syscall_open __NR_open
static inline _syscall3(int, __syscall_open, const char *, file,
int, flags, __kernel_mode_t, mode);
-int attribute_hidden __open(const char *file, int flags, ...)
+int __libc_open(const char *file, int flags, ...)
{
/* gcc may warn about mode being uninitialized.
* Just ignore that, since gcc is wrong. */
@@ -35,10 +33,14 @@ int attribute_hidden __open(const char *file, int flags, ...)
}
return __syscall_open(file, flags, mode);
}
-strong_alias(__open,open)
-weak_alias(__open,__libc_open)
+libc_hidden_proto(__libc_open)
+libc_hidden_def(__libc_open)
+
+strong_alias(__libc_open,open)
+libc_hidden_proto(open)
+libc_hidden_def(open)
int creat(const char *file, mode_t mode)
{
- return __open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+ return __libc_open(file, O_WRONLY | O_CREAT | O_TRUNC, mode);
}
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index f577d9507..fbe99b0d9 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -26,10 +26,12 @@
#endif
#ifdef __UCLIBC_HAS_LFS__
+extern int __libc_open (__const char *__file, int __oflag, ...) __nonnull ((1));
+libc_hidden_proto(__libc_open)
+
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
a third argument is the file protection. */
-#undef open64
-int attribute_hidden __open64 (const char *file, int oflag, ...)
+int __libc_open64 (const char *file, int oflag, ...)
{
int mode = 0;
@@ -41,8 +43,10 @@ int attribute_hidden __open64 (const char *file, int oflag, ...)
va_end (arg);
}
- return __open(file, oflag | O_LARGEFILE, mode);
+ return __libc_open(file, oflag | O_LARGEFILE, mode);
}
-strong_alias(__open64,open64)
-weak_alias(__open64,__libc_open64)
+
+strong_alias(__libc_open64,open64)
+libc_hidden_proto(open64)
+libc_hidden_def(open64)
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/common/pause.c b/libc/sysdeps/linux/common/pause.c
index a017ef611..1028a7a63 100644
--- a/libc/sysdeps/linux/common/pause.c
+++ b/libc/sysdeps/linux/common/pause.c
@@ -7,9 +7,6 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-#define __sigpause __sigpause_internal
-#define sigblock __sigblock
-
#include "syscalls.h"
#include <unistd.h>
@@ -18,9 +15,12 @@
_syscall0(int, __libc_pause);
#else
#include <signal.h>
+libc_hidden_proto(__sigpause)
+libc_hidden_proto(sigblock)
+
int __libc_pause(void)
{
return (__sigpause(sigblock(0), 0));
}
#endif
-weak_alias(__libc_pause, pause)
+strong_alias(__libc_pause,pause)
diff --git a/libc/sysdeps/linux/common/pipe.c b/libc/sysdeps/linux/common/pipe.c
index 2045b8d64..93d52b88f 100644
--- a/libc/sysdeps/linux/common/pipe.c
+++ b/libc/sysdeps/linux/common/pipe.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___pipe __NR_pipe
-attribute_hidden _syscall1(int, __pipe, int *, filedes);
-strong_alias(__pipe,pipe)
+_syscall1(int, pipe, int *, filedes);
+libc_hidden_proto(pipe)
+libc_hidden_def(pipe)
diff --git a/libc/sysdeps/linux/common/poll.c b/libc/sysdeps/linux/common/poll.c
index c957f1edf..c76df966f 100644
--- a/libc/sysdeps/linux/common/poll.c
+++ b/libc/sysdeps/linux/common/poll.c
@@ -17,15 +17,11 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define getdtablesize __getdtablesize
-#define select __select
-
#include "syscalls.h"
#include <sys/poll.h>
#ifdef __NR_poll
-#define __NR___poll __NR_poll
-attribute_hidden _syscall3(int, __poll, struct pollfd *, fds,
+_syscall3(int, poll, struct pollfd *, fds,
unsigned long int, nfds, int, timeout);
#else
@@ -37,6 +33,11 @@ attribute_hidden _syscall3(int, __poll, struct pollfd *, fds,
#include <sys/param.h>
#include <unistd.h>
+libc_hidden_proto(memcpy)
+libc_hidden_proto(memset)
+libc_hidden_proto(getdtablesize)
+libc_hidden_proto(select)
+
/* uClinux 2.0 doesn't have poll, emulate it using select */
/* Poll the file descriptors described by the NFDS structures starting at
@@ -45,7 +46,7 @@ attribute_hidden _syscall3(int, __poll, struct pollfd *, fds,
Returns the number of file descriptors with events, zero if timed out,
or -1 for errors. */
-int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
+int poll(struct pollfd *fds, nfds_t nfds, int timeout)
{
static int max_fd_size;
struct timeval tv;
@@ -65,9 +66,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
/* We can't call FD_ZERO, since FD_ZERO only works with sets
of exactly __FD_SETSIZE size. */
- __memset (rset, 0, bytes);
- __memset (wset, 0, bytes);
- __memset (xset, 0, bytes);
+ memset (rset, 0, bytes);
+ memset (wset, 0, bytes);
+ memset (xset, 0, bytes);
for (f = fds; f < &fds[nfds]; ++f)
{
@@ -89,13 +90,13 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
nwset = alloca (nbytes);
nxset = alloca (nbytes);
- __memset ((char *) nrset + bytes, 0, nbytes - bytes);
- __memset ((char *) nwset + bytes, 0, nbytes - bytes);
- __memset ((char *) nxset + bytes, 0, nbytes - bytes);
+ memset ((char *) nrset + bytes, 0, nbytes - bytes);
+ memset ((char *) nwset + bytes, 0, nbytes - bytes);
+ memset ((char *) nxset + bytes, 0, nbytes - bytes);
- rset = __memcpy (nrset, rset, bytes);
- wset = __memcpy (nwset, wset, bytes);
- xset = __memcpy (nxset, xset, bytes);
+ rset = memcpy (nrset, rset, bytes);
+ wset = memcpy (nwset, wset, bytes);
+ xset = memcpy (nxset, xset, bytes);
bytes = nbytes;
}
@@ -129,9 +130,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
struct timeval sngl_tv;
/* Clear the original set. */
- __memset (rset, 0, bytes);
- __memset (wset, 0, bytes);
- __memset (xset, 0, bytes);
+ memset (rset, 0, bytes);
+ memset (wset, 0, bytes);
+ memset (xset, 0, bytes);
/* This means we don't wait for input. */
sngl_tv.tv_sec = 0;
@@ -148,9 +149,9 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
{
int n;
- __memset (sngl_rset, 0, bytes);
- __memset (sngl_wset, 0, bytes);
- __memset (sngl_xset, 0, bytes);
+ memset (sngl_rset, 0, bytes);
+ memset (sngl_wset, 0, bytes);
+ memset (sngl_xset, 0, bytes);
if (f->events & POLLIN)
FD_SET (f->fd, sngl_rset);
@@ -204,4 +205,5 @@ int attribute_hidden __poll(struct pollfd *fds, nfds_t nfds, int timeout)
}
#endif
-strong_alias(__poll,poll)
+libc_hidden_proto(poll)
+libc_hidden_def(poll)
diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c
index 5662a440c..72419be7b 100644
--- a/libc/sysdeps/linux/common/posix_fadvise.c
+++ b/libc/sysdeps/linux/common/posix_fadvise.c
@@ -8,12 +8,8 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-/* need to hide the posix_fadvise64 prototype or the weak_alias()
- * will fail when __NR_fadvise64_64 doesnt exist */
-#define posix_fadvise64 __hide_posix_fadvise64
#include "syscalls.h"
#include <fcntl.h>
-#undef posix_fadvise64
#ifdef __NR_fadvise64
#define __NR_posix_fadvise __NR_fadvise64
@@ -21,7 +17,7 @@ _syscall4(int, posix_fadvise, int, fd, off_t, offset,
off_t, len, int, advice);
#if defined __UCLIBC_HAS_LFS__ && (!defined __NR_fadvise64_64 || !defined _syscall6)
-weak_alias(posix_fadvise, posix_fadvise64)
+strong_alias(posix_fadvise,posix_fadvise64)
#endif
#else
diff --git a/libc/sysdeps/linux/common/posix_fadvise64.c b/libc/sysdeps/linux/common/posix_fadvise64.c
index 5c5cf9906..e5f23d509 100644
--- a/libc/sysdeps/linux/common/posix_fadvise64.c
+++ b/libc/sysdeps/linux/common/posix_fadvise64.c
@@ -52,7 +52,7 @@ int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
#endif
#elif !defined __NR_fadvise64
-/* This is declared as a weak alias in posix_fadvise.c if __NR_fadvise64
+/* This is declared as a strong alias in posix_fadvise.c if __NR_fadvise64
* is defined.
*/
int posix_fadvise64(int fd, __off64_t offset, __off64_t len, int advice)
diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c
index 7183ac9a7..c622b22d2 100644
--- a/libc/sysdeps/linux/common/pread_write.c
+++ b/libc/sysdeps/linux/common/pread_write.c
@@ -40,6 +40,12 @@
#include <unistd.h>
#include <stdint.h>
+#ifdef __UCLIBC_HAS_LFS__
+libc_hidden_proto(lseek64)
+#else
+libc_hidden_proto(lseek)
+#endif
+
#ifdef __NR_pread
#define __NR___syscall_pread __NR_pread
@@ -50,7 +56,7 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__syscall_pread(fd,buf,count,__LONG_LONG_PAIR (offset >> 31, offset)));
}
-weak_alias (__libc_pread, pread)
+strong_alias(__libc_pread,pread)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
@@ -59,7 +65,7 @@ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
uint32_t high = offset >> 32;
return(__syscall_pread(fd, buf, count, __LONG_LONG_PAIR (high, low)));
}
-weak_alias (__libc_pread64, pread64)
+strong_alias(__libc_pread64,pread64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* __NR_pread */
@@ -75,7 +81,7 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
return(__syscall_pwrite(fd,buf,count,__LONG_LONG_PAIR (offset >> 31, offset)));
}
-weak_alias (__libc_pwrite, pwrite)
+strong_alias(__libc_pwrite,pwrite)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
@@ -84,7 +90,7 @@ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
uint32_t high = offset >> 32;
return(__syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR (high, low)));
}
-weak_alias (__libc_pwrite64, pwrite64)
+strong_alias(__libc_pwrite64,pwrite64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* __NR_pwrite */
@@ -100,11 +106,11 @@ static ssize_t __fake_pread_write(int fd, void *buf,
/* Since we must not change the file pointer preserve the
* value so that we can restore it later. */
- if ((old_offset=__lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
+ if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
return -1;
/* Set to wanted position. */
- if (__lseek (fd, offset, SEEK_SET) == (off_t) -1)
+ if (lseek (fd, offset, SEEK_SET) == (off_t) -1)
return -1;
if (do_pwrite==1) {
@@ -118,7 +124,7 @@ static ssize_t __fake_pread_write(int fd, void *buf,
/* Now we have to restore the position. If this fails we
* have to return this as an error. */
save_errno = errno;
- if (__lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
+ if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
{
if (result == -1)
__set_errno(save_errno);
@@ -138,11 +144,11 @@ static ssize_t __fake_pread_write64(int fd, void *buf,
/* Since we must not change the file pointer preserve the
* value so that we can restore it later. */
- if ((old_offset=__lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
+ if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
return -1;
/* Set to wanted position. */
- if (__lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+ if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
return -1;
if (do_pwrite==1) {
@@ -155,7 +161,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf,
/* Now we have to restore the position. */
save_errno = errno;
- if (__lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) {
+ if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) {
if (result == -1)
__set_errno (save_errno);
return -1;
@@ -171,14 +177,14 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__fake_pread_write(fd, buf, count, offset, 0));
}
-weak_alias (__libc_pread, pread)
+strong_alias(__libc_pread,pread)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
{
return(__fake_pread_write64(fd, buf, count, offset, 0));
}
-weak_alias (__libc_pread64, pread64)
+strong_alias(__libc_pread64,pread64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* ! __NR_pread */
@@ -190,14 +196,13 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
*just cast it to get rid of warnings */
return(__fake_pread_write(fd, (void*)buf, count, offset, 1));
}
-weak_alias (__libc_pwrite, pwrite)
+strong_alias(__libc_pwrite,pwrite)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
{
return(__fake_pread_write64(fd, (void*)buf, count, offset, 1));
}
-weak_alias (__libc_pwrite64, pwrite64)
+strong_alias(__libc_pwrite64,pwrite64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* ! __NR_pwrite */
-
diff --git a/libc/sysdeps/linux/common/read.c b/libc/sysdeps/linux/common/read.c
index 6490bccbc..912533e55 100644
--- a/libc/sysdeps/linux/common/read.c
+++ b/libc/sysdeps/linux/common/read.c
@@ -10,7 +10,8 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___read __NR_read
-attribute_hidden _syscall3(ssize_t, __read, int, fd, __ptr_t, buf, size_t, count);
-strong_alias(__read,read)
-weak_alias(__read,__libc_read)
+#define __NR___libc_read __NR_read
+_syscall3(ssize_t, __libc_read, int, fd, __ptr_t, buf, size_t, count);
+strong_alias(__libc_read,read)
+libc_hidden_proto(read)
+libc_hidden_def(read)
diff --git a/libc/sysdeps/linux/common/readlink.c b/libc/sysdeps/linux/common/readlink.c
index 45db1a64f..d1587154d 100644
--- a/libc/sysdeps/linux/common/readlink.c
+++ b/libc/sysdeps/linux/common/readlink.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___readlink __NR_readlink
-attribute_hidden _syscall3(int, __readlink, const char *, path, char *, buf, size_t, bufsiz);
-strong_alias(__readlink,readlink)
+_syscall3(int, readlink, const char *, path, char *, buf, size_t, bufsiz);
+libc_hidden_proto(readlink)
+libc_hidden_def(readlink)
diff --git a/libc/sysdeps/linux/common/rmdir.c b/libc/sysdeps/linux/common/rmdir.c
index 2f2c8a335..706fa0fd3 100644
--- a/libc/sysdeps/linux/common/rmdir.c
+++ b/libc/sysdeps/linux/common/rmdir.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___rmdir __NR_rmdir
-attribute_hidden _syscall1(int, __rmdir, const char *, pathname);
-strong_alias(__rmdir,rmdir)
+_syscall1(int, rmdir, const char *, pathname);
+libc_hidden_proto(rmdir)
+libc_hidden_def(rmdir)
diff --git a/libc/sysdeps/linux/common/sbrk.c b/libc/sysdeps/linux/common/sbrk.c
index d8507335b..bdc8c68a7 100644
--- a/libc/sysdeps/linux/common/sbrk.c
+++ b/libc/sysdeps/linux/common/sbrk.c
@@ -19,29 +19,31 @@
#include <unistd.h>
#include <errno.h>
+libc_hidden_proto(brk)
+
/* Defined in brk.c. */
extern void *__curbrk;
-extern int __brk (void *addr) attribute_hidden;
/* Extend the process's data space by INCREMENT.
If INCREMENT is negative, shrink data space by - INCREMENT.
Return start of new space allocated, or -1 for errors. */
-void attribute_hidden * __sbrk (intptr_t increment)
+void * sbrk (intptr_t increment)
{
void *oldbrk;
if (__curbrk == NULL)
- if (__brk (0) < 0) /* Initialize the break. */
+ if (brk (0) < 0) /* Initialize the break. */
return (void *) -1;
if (increment == 0)
return __curbrk;
oldbrk = __curbrk;
- if (__brk (oldbrk + increment) < 0)
+ if (brk (oldbrk + increment) < 0)
return (void *) -1;
return oldbrk;
}
-strong_alias(__sbrk,sbrk)
+libc_hidden_proto(sbrk)
+libc_hidden_def(sbrk)
diff --git a/libc/sysdeps/linux/common/select.c b/libc/sysdeps/linux/common/select.c
index 36f88229a..19e14b99a 100644
--- a/libc/sysdeps/linux/common/select.c
+++ b/libc/sysdeps/linux/common/select.c
@@ -11,10 +11,10 @@
#include <unistd.h>
#ifdef __NR__newselect
-#define __NR___select __NR__newselect
-#else
-#define __NR___select __NR_select
+#undef __NR_select
+#define __NR_select __NR__newselect
#endif
-attribute_hidden _syscall5(int, __select, int, n, fd_set *, readfds, fd_set *, writefds,
+_syscall5(int, select, int, n, fd_set *, readfds, fd_set *, writefds,
fd_set *, exceptfds, struct timeval *, timeout);
-strong_alias(__select,select)
+libc_hidden_proto(select)
+libc_hidden_def(select)
diff --git a/libc/sysdeps/linux/common/setegid.c b/libc/sysdeps/linux/common/setegid.c
index d3175dad5..dcd207132 100644
--- a/libc/sysdeps/linux/common/setegid.c
+++ b/libc/sysdeps/linux/common/setegid.c
@@ -1,5 +1,8 @@
-#define setresgid __setresgid
-#define setregid __setregid
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#define _GNU_SOURCE
#include <unistd.h>
@@ -9,6 +12,9 @@
#include <sys/types.h>
#include <sys/syscall.h>
+libc_hidden_proto(setresgid)
+libc_hidden_proto(setregid)
+
int setegid(gid_t gid)
{
int result;
diff --git a/libc/sysdeps/linux/common/seteuid.c b/libc/sysdeps/linux/common/seteuid.c
index f5ed35743..aeb6356e5 100644
--- a/libc/sysdeps/linux/common/seteuid.c
+++ b/libc/sysdeps/linux/common/seteuid.c
@@ -1,5 +1,8 @@
-#define setresuid __setresuid
-#define setreuid __setreuid
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#define _GNU_SOURCE
#include <unistd.h>
@@ -9,7 +12,10 @@
#include <sys/types.h>
#include <sys/syscall.h>
-int attribute_hidden __seteuid(uid_t uid)
+libc_hidden_proto(setresuid)
+libc_hidden_proto(setreuid)
+
+int seteuid(uid_t uid)
{
int result;
@@ -29,4 +35,4 @@ int attribute_hidden __seteuid(uid_t uid)
return result;
}
-strong_alias(__seteuid,seteuid)
+libc_hidden_proto(seteuid)
diff --git a/libc/sysdeps/linux/common/setgroups.c b/libc/sysdeps/linux/common/setgroups.c
index 49d85156f..a41578d62 100644
--- a/libc/sysdeps/linux/common/setgroups.c
+++ b/libc/sysdeps/linux/common/setgroups.c
@@ -7,18 +7,18 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-#define sysconf __sysconf
-
#include "syscalls.h"
#include <stdlib.h>
#include <unistd.h>
#include <grp.h>
+libc_hidden_proto(sysconf)
+
#define __NR___syscall_setgroups __NR_setgroups
static inline _syscall2(int, __syscall_setgroups,
size_t, size, const __kernel_gid_t *, list);
-int attribute_hidden __setgroups(size_t size, const gid_t *groups)
+int setgroups(size_t size, const gid_t *groups)
{
if (size > (size_t) sysconf(_SC_NGROUPS_MAX)) {
ret_error:
@@ -47,4 +47,5 @@ ret_error:
return i;
}
}
-strong_alias(__setgroups,setgroups)
+libc_hidden_proto(setgroups)
+libc_hidden_def(setgroups)
diff --git a/libc/sysdeps/linux/common/setitimer.c b/libc/sysdeps/linux/common/setitimer.c
index be51cb5c5..f34a9f39c 100644
--- a/libc/sysdeps/linux/common/setitimer.c
+++ b/libc/sysdeps/linux/common/setitimer.c
@@ -9,7 +9,7 @@
#include "syscalls.h"
#include <sys/time.h>
-#define __NR___setitimer __NR_setitimer
-attribute_hidden _syscall3(int, __setitimer, __itimer_which_t, which,
+_syscall3(int, setitimer, __itimer_which_t, which,
const struct itimerval *, new, struct itimerval *, old);
-strong_alias(__setitimer,setitimer)
+libc_hidden_proto(setitimer)
+libc_hidden_def(setitimer)
diff --git a/libc/sysdeps/linux/common/setpgid.c b/libc/sysdeps/linux/common/setpgid.c
index 6d73f08ec..0453fbdfb 100644
--- a/libc/sysdeps/linux/common/setpgid.c
+++ b/libc/sysdeps/linux/common/setpgid.c
@@ -14,8 +14,9 @@
static inline _syscall2(int, __syscall_setpgid,
__kernel_pid_t, pid, __kernel_pid_t, pgid);
-int attribute_hidden __setpgid(pid_t pid, pid_t pgid)
+int setpgid(pid_t pid, pid_t pgid)
{
return (__syscall_setpgid(pid, pgid));
}
-strong_alias(__setpgid,setpgid)
+libc_hidden_proto(setpgid)
+libc_hidden_def(setpgid)
diff --git a/libc/sysdeps/linux/common/setpgrp.c b/libc/sysdeps/linux/common/setpgrp.c
index 966bb4da6..38300dc2e 100644
--- a/libc/sysdeps/linux/common/setpgrp.c
+++ b/libc/sysdeps/linux/common/setpgrp.c
@@ -1,8 +1,14 @@
-#define setpgid __setpgid
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <syscall.h>
#include <unistd.h>
+libc_hidden_proto(setpgid)
+
int setpgrp(void)
{
return setpgid(0,0);
diff --git a/libc/sysdeps/linux/common/setpriority.c b/libc/sysdeps/linux/common/setpriority.c
index 06476d88f..7347786af 100644
--- a/libc/sysdeps/linux/common/setpriority.c
+++ b/libc/sysdeps/linux/common/setpriority.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <sys/resource.h>
-#define __NR___setpriority __NR_setpriority
-attribute_hidden _syscall3(int, __setpriority, __priority_which_t, which, id_t, who, int, prio);
-strong_alias(__setpriority,setpriority)
+_syscall3(int, setpriority, __priority_which_t, which, id_t, who, int, prio);
+libc_hidden_proto(setpriority)
+libc_hidden_def(setpriority)
diff --git a/libc/sysdeps/linux/common/setregid.c b/libc/sysdeps/linux/common/setregid.c
index cfd375744..043afffc9 100644
--- a/libc/sysdeps/linux/common/setregid.c
+++ b/libc/sysdeps/linux/common/setregid.c
@@ -14,7 +14,7 @@
static inline _syscall2(int, __syscall_setregid,
__kernel_gid_t, rgid, __kernel_gid_t, egid);
-int attribute_hidden __setregid(gid_t rgid, gid_t egid)
+int setregid(gid_t rgid, gid_t egid)
{
if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
@@ -23,4 +23,4 @@ int attribute_hidden __setregid(gid_t rgid, gid_t egid)
}
return (__syscall_setregid(rgid, egid));
}
-strong_alias(__setregid,setregid)
+libc_hidden_proto(setregid)
diff --git a/libc/sysdeps/linux/common/setresgid.c b/libc/sysdeps/linux/common/setresgid.c
index fbfa98be3..82087d1c1 100644
--- a/libc/sysdeps/linux/common/setresgid.c
+++ b/libc/sysdeps/linux/common/setresgid.c
@@ -14,7 +14,7 @@
static inline _syscall3(int, __syscall_setresgid,
__kernel_gid_t, rgid, __kernel_gid_t, egid, __kernel_gid_t, sgid);
-int attribute_hidden __setresgid(gid_t rgid, gid_t egid, gid_t sgid)
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
{
if (((rgid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
|| ((egid + 1) > (gid_t) ((__kernel_gid_t) - 1U))
@@ -24,5 +24,6 @@ int attribute_hidden __setresgid(gid_t rgid, gid_t egid, gid_t sgid)
}
return (__syscall_setresgid(rgid, egid, sgid));
}
-strong_alias(__setresgid,setresgid)
+libc_hidden_proto(setresgid)
+libc_hidden_def(setresgid)
#endif
diff --git a/libc/sysdeps/linux/common/setresuid.c b/libc/sysdeps/linux/common/setresuid.c
index 6ed1423f5..7d34c4027 100644
--- a/libc/sysdeps/linux/common/setresuid.c
+++ b/libc/sysdeps/linux/common/setresuid.c
@@ -14,7 +14,7 @@
static inline _syscall3(int, __syscall_setresuid,
__kernel_uid_t, rgid, __kernel_uid_t, egid, __kernel_uid_t, sgid);
-int attribute_hidden __setresuid(uid_t ruid, uid_t euid, uid_t suid)
+int setresuid(uid_t ruid, uid_t euid, uid_t suid)
{
if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
@@ -24,5 +24,6 @@ int attribute_hidden __setresuid(uid_t ruid, uid_t euid, uid_t suid)
}
return (__syscall_setresuid(ruid, euid, suid));
}
-strong_alias(__setresuid,setresuid)
+libc_hidden_proto(setresuid)
+libc_hidden_def(setresuid)
#endif
diff --git a/libc/sysdeps/linux/common/setreuid.c b/libc/sysdeps/linux/common/setreuid.c
index 15ab5c01a..93684d047 100644
--- a/libc/sysdeps/linux/common/setreuid.c
+++ b/libc/sysdeps/linux/common/setreuid.c
@@ -14,7 +14,7 @@
static inline _syscall2(int, __syscall_setreuid,
__kernel_uid_t, ruid, __kernel_uid_t, euid);
-int attribute_hidden __setreuid(uid_t ruid, uid_t euid)
+int setreuid(uid_t ruid, uid_t euid)
{
if (((ruid + 1) > (uid_t) ((__kernel_uid_t) - 1U))
|| ((euid + 1) > (uid_t) ((__kernel_uid_t) - 1U))) {
@@ -23,4 +23,5 @@ int attribute_hidden __setreuid(uid_t ruid, uid_t euid)
}
return (__syscall_setreuid(ruid, euid));
}
-strong_alias(__setreuid,setreuid)
+libc_hidden_proto(setreuid)
+libc_hidden_def(setreuid)
diff --git a/libc/sysdeps/linux/common/setrlimit.c b/libc/sysdeps/linux/common/setrlimit.c
index 9c5466a09..08e955e05 100644
--- a/libc/sysdeps/linux/common/setrlimit.c
+++ b/libc/sysdeps/linux/common/setrlimit.c
@@ -18,7 +18,7 @@
#define RMIN(x, y) ((x) < (y) ? (x) : (y))
static inline
_syscall2(int, __syscall_setrlimit, int, resource, const struct rlimit *, rlim);
-int attribute_hidden __setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits)
+int setrlimit(__rlimit_resource_t resource, const struct rlimit *rlimits)
{
struct rlimit rlimits_small;
@@ -37,9 +37,9 @@ int attribute_hidden __setrlimit(__rlimit_resource_t resource, const struct rlim
#include <unistd.h>
struct rlimit;
-#define __NR___setrlimit __NR_setrlimit
-attribute_hidden _syscall2(int, __setrlimit, unsigned int, resource,
+_syscall2(int, setrlimit, unsigned int, resource,
const struct rlimit *, rlim);
#endif
-strong_alias(__setrlimit,setrlimit)
+libc_hidden_proto(setrlimit)
+libc_hidden_def(setrlimit)
diff --git a/libc/sysdeps/linux/common/setrlimit64.c b/libc/sysdeps/linux/common/setrlimit64.c
index d59057c90..b0d84de53 100644
--- a/libc/sysdeps/linux/common/setrlimit64.c
+++ b/libc/sysdeps/linux/common/setrlimit64.c
@@ -16,8 +16,6 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define setrlimit __setrlimit
-
#include <features.h>
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64
@@ -38,6 +36,8 @@
#if defined __UCLIBC_HAS_LFS__
+libc_hidden_proto(setrlimit)
+
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
Only the super-user can increase hard limits.
Return 0 if successful, -1 if not (and sets errno). */
diff --git a/libc/sysdeps/linux/common/setsid.c b/libc/sysdeps/linux/common/setsid.c
index b3e1e8706..6b63e3a31 100644
--- a/libc/sysdeps/linux/common/setsid.c
+++ b/libc/sysdeps/linux/common/setsid.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___setsid __NR_setsid
-attribute_hidden _syscall0(pid_t, __setsid);
-strong_alias(__setsid,setsid)
+_syscall0(pid_t, setsid);
+libc_hidden_proto(setsid)
+libc_hidden_def(setsid)
diff --git a/libc/sysdeps/linux/common/settimeofday.c b/libc/sysdeps/linux/common/settimeofday.c
index 4e88b3edb..7f4c336a2 100644
--- a/libc/sysdeps/linux/common/settimeofday.c
+++ b/libc/sysdeps/linux/common/settimeofday.c
@@ -9,7 +9,7 @@
#include "syscalls.h"
#include <sys/time.h>
-#define __NR___settimeofday __NR_settimeofday
-attribute_hidden _syscall2(int, __settimeofday, const struct timeval *, tv,
+attribute_hidden _syscall2(int, settimeofday, const struct timeval *, tv,
const struct timezone *, tz);
-strong_alias(__settimeofday,settimeofday)
+libc_hidden_proto(settimeofday)
+libc_hidden_def(settimeofday)
diff --git a/libc/sysdeps/linux/common/sigprocmask.c b/libc/sysdeps/linux/common/sigprocmask.c
index 7a18648e8..6ca040c59 100644
--- a/libc/sysdeps/linux/common/sigprocmask.c
+++ b/libc/sysdeps/linux/common/sigprocmask.c
@@ -19,7 +19,7 @@ static inline
_syscall4(int, __rt_sigprocmask, int, how, const sigset_t *, set,
sigset_t *, oldset, size_t, size);
-int attribute_hidden __sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
{
if (set &&
#if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
@@ -44,7 +44,7 @@ static inline
_syscall3(int, __syscall_sigprocmask, int, how, const sigset_t *, set,
sigset_t *, oldset);
-int attribute_hidden __sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
+int sigprocmask(int how, const sigset_t * set, sigset_t * oldset)
{
if (set &&
#if (SIG_BLOCK == 0) && (SIG_UNBLOCK == 1) && (SIG_SETMASK == 2)
@@ -62,4 +62,5 @@ int attribute_hidden __sigprocmask(int how, const sigset_t * set, sigset_t * old
}
#endif
-strong_alias(__sigprocmask,sigprocmask)
+libc_hidden_proto(sigprocmask)
+libc_hidden_def(sigprocmask)
diff --git a/libc/sysdeps/linux/common/sigsuspend.c b/libc/sysdeps/linux/common/sigsuspend.c
index be69c62c2..be90d7e87 100644
--- a/libc/sysdeps/linux/common/sigsuspend.c
+++ b/libc/sysdeps/linux/common/sigsuspend.c
@@ -15,7 +15,7 @@
#define __NR___rt_sigsuspend __NR_rt_sigsuspend
static inline _syscall2(int, __rt_sigsuspend, const sigset_t *, mask, size_t, size);
-int attribute_hidden __sigsuspend(const sigset_t * mask)
+int sigsuspend(const sigset_t * mask)
{
return __rt_sigsuspend(mask, _NSIG / 8);
}
@@ -24,9 +24,10 @@ int attribute_hidden __sigsuspend(const sigset_t * mask)
static inline _syscall3(int, __syscall_sigsuspend, int, a, unsigned long int, b,
unsigned long int, c);
-int attribute_hidden __sigsuspend(const sigset_t * set)
+int sigsuspend(const sigset_t * set)
{
return __syscall_sigsuspend(0, 0, set->__val[0]);
}
#endif
-strong_alias(__sigsuspend,sigsuspend)
+libc_hidden_proto(sigsuspend)
+libc_hidden_def(sigsuspend)
diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c
index ecd9dd8d7..33d84e5eb 100644
--- a/libc/sysdeps/linux/common/ssp.c
+++ b/libc/sysdeps/linux/common/ssp.c
@@ -26,19 +26,25 @@
# define SSP_SIGTYPE SIGABRT
#endif
-#define openlog __openlog
-#define syslog __syslog
-#define closelog __closelog
-#define sigfillset __sigfillset_internal
-#define sigdelset __sigdelset_internal
-#define sigaction __sigaction
-#define kill __kill
-
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <sys/syslog.h>
+libc_hidden_proto(memset)
+libc_hidden_proto(strlen)
+libc_hidden_proto(sigaction)
+libc_hidden_proto(sigfillset)
+libc_hidden_proto(sigdelset)
+libc_hidden_proto(sigprocmask)
+libc_hidden_proto(write)
+libc_hidden_proto(openlog)
+libc_hidden_proto(syslog)
+libc_hidden_proto(closelog)
+libc_hidden_proto(kill)
+libc_hidden_proto(getpid)
+libc_hidden_proto(_exit)
+
static void block_signals(void)
{
struct sigaction sa;
@@ -47,10 +53,10 @@ static void block_signals(void)
sigfillset(&mask);
sigdelset(&mask, SSP_SIGTYPE); /* Block all signal handlers */
- __sigprocmask(SIG_BLOCK, &mask, NULL); /* except SSP_SIGTYPE */
+ sigprocmask(SIG_BLOCK, &mask, NULL); /* except SSP_SIGTYPE */
/* Make the default handler associated with the signal handler */
- __memset(&sa, 0, sizeof(struct sigaction));
+ memset(&sa, 0, sizeof(struct sigaction));
sigfillset(&sa.sa_mask); /* Block all signals */
sa.sa_flags = 0;
sa.sa_handler = SIG_DFL;
@@ -59,10 +65,10 @@ static void block_signals(void)
static void ssp_write(int fd, const char *msg1, const char *msg2, const char *msg3)
{
- __write(fd, msg1, __strlen(msg1));
- __write(fd, msg2, __strlen(msg2));
- __write(fd, msg3, __strlen(msg3));
- __write(fd, "()\n", 3);
+ write(fd, msg1, strlen(msg1));
+ write(fd, msg2, strlen(msg2));
+ write(fd, msg3, strlen(msg3));
+ write(fd, "()\n", 3);
openlog("ssp", LOG_CONS | LOG_PID, LOG_USER);
syslog(LOG_INFO, "%s%s%s()", msg1, msg2, msg3);
closelog();
@@ -70,8 +76,8 @@ static void ssp_write(int fd, const char *msg1, const char *msg2, const char *ms
static attribute_noreturn void terminate(void)
{
- (void) kill(__getpid(), SSP_SIGTYPE);
- _exit_internal(127);
+ (void) kill(getpid(), SSP_SIGTYPE);
+ _exit(127);
}
void attribute_noreturn __stack_smash_handler(char func[], int damaged __attribute__ ((unused)));
diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c
index 7cc6131b3..51e353f96 100644
--- a/libc/sysdeps/linux/common/stat.c
+++ b/libc/sysdeps/linux/common/stat.c
@@ -10,7 +10,6 @@
/* need to hide the 64bit prototype or the weak_alias()
* will fail when __NR_stat64 doesnt exist */
#define stat64 __hidestat64
-#define __stat64 __hide__stat64
#include "syscalls.h"
#include <unistd.h>
@@ -18,15 +17,13 @@
#include "xstatconv.h"
#undef stat64
-#undef __stat64
#define __NR___syscall_stat __NR_stat
-#undef __stat
#undef stat
static inline _syscall2(int, __syscall_stat,
const char *, file_name, struct kernel_stat *, buf);
-int attribute_hidden __stat(const char *file_name, struct stat *buf)
+int stat(const char *file_name, struct stat *buf)
{
int result;
struct kernel_stat kbuf;
@@ -37,9 +34,11 @@ int attribute_hidden __stat(const char *file_name, struct stat *buf)
}
return result;
}
-strong_alias(__stat,stat)
+libc_hidden_proto(stat)
+libc_hidden_def(stat)
#if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__
-hidden_strong_alias(__stat,__stat64)
-weak_alias(__stat,stat64)
+strong_alias(stat,stat64)
+libc_hidden_proto(stat64)
+libc_hidden_def(stat64)
#endif
diff --git a/libc/sysdeps/linux/common/stat64.c b/libc/sysdeps/linux/common/stat64.c
index dcd9163fb..e46cf8a25 100644
--- a/libc/sysdeps/linux/common/stat64.c
+++ b/libc/sysdeps/linux/common/stat64.c
@@ -18,8 +18,7 @@
static inline _syscall2(int, __syscall_stat64,
const char *, file_name, struct kernel_stat64 *, buf);
-#undef stat64
-int attribute_hidden __stat64(const char *file_name, struct stat64 *buf)
+int stat64(const char *file_name, struct stat64 *buf)
{
int result;
struct kernel_stat64 kbuf;
@@ -30,6 +29,7 @@ int attribute_hidden __stat64(const char *file_name, struct stat64 *buf)
}
return result;
}
-strong_alias(__stat64,stat64)
+libc_hidden_proto(stat64)
+libc_hidden_def(stat64)
#endif /* __UCLIBC_HAS_LFS__ */
diff --git a/libc/sysdeps/linux/common/statfs.c b/libc/sysdeps/linux/common/statfs.c
index f8aa9d3ba..d931707f4 100644
--- a/libc/sysdeps/linux/common/statfs.c
+++ b/libc/sysdeps/linux/common/statfs.c
@@ -16,8 +16,9 @@
static inline _syscall2(int, __syscall_statfs,
const char *, path, struct statfs *, buf);
-int attribute_hidden __statfs(const char *path, struct statfs * buf)
+int statfs(const char *path, struct statfs * buf)
{
return __syscall_statfs(path, buf);
}
-strong_alias(__statfs,statfs)
+libc_hidden_proto(statfs)
+libc_hidden_def(statfs)
diff --git a/libc/sysdeps/linux/common/time.c b/libc/sysdeps/linux/common/time.c
index 02ebd5570..a4dc1c742 100644
--- a/libc/sysdeps/linux/common/time.c
+++ b/libc/sysdeps/linux/common/time.c
@@ -7,16 +7,15 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-#define gettimeofday __gettimeofday
-
#include "syscalls.h"
#include <time.h>
#include <sys/time.h>
#ifdef __NR_time
-#define __NR___time __NR_time
-attribute_hidden _syscall1(time_t, __time, time_t *, t);
+_syscall1(time_t, time, time_t *, t);
#else
-time_t attribute_hidden __time(time_t * t)
+libc_hidden_proto(gettimeofday)
+
+time_t time(time_t * t)
{
time_t result;
struct timeval tv;
@@ -32,4 +31,5 @@ time_t attribute_hidden __time(time_t * t)
return result;
}
#endif
-strong_alias(__time,time)
+libc_hidden_proto(time)
+libc_hidden_def(time)
diff --git a/libc/sysdeps/linux/common/times.c b/libc/sysdeps/linux/common/times.c
index 0fefdca10..fa751a03b 100644
--- a/libc/sysdeps/linux/common/times.c
+++ b/libc/sysdeps/linux/common/times.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <sys/times.h>
-#define __NR___times __NR_times
-attribute_hidden _syscall1(clock_t, __times, struct tms *, buf);
-strong_alias(__times,times)
+_syscall1(clock_t, times, struct tms *, buf);
+libc_hidden_proto(times)
+libc_hidden_def(times)
diff --git a/libc/sysdeps/linux/common/truncate.c b/libc/sysdeps/linux/common/truncate.c
index dd69bcb3e..d0b04ebee 100644
--- a/libc/sysdeps/linux/common/truncate.c
+++ b/libc/sysdeps/linux/common/truncate.c
@@ -10,4 +10,5 @@
#include "syscalls.h"
#include <unistd.h>
_syscall2(int, truncate, const char *, path, __off_t, length);
-hidden_strong_alias(truncate, __truncate)
+libc_hidden_proto(truncate)
+libc_hidden_def(truncate)
diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c
index 06b076c4f..df6c9e4d5 100644
--- a/libc/sysdeps/linux/common/truncate64.c
+++ b/libc/sysdeps/linux/common/truncate64.c
@@ -12,8 +12,6 @@
* the main directory of this archive for more details.
*/
-#define truncate __truncate
-
#include <features.h>
#include <unistd.h>
#include <errno.h>
@@ -66,6 +64,8 @@ int truncate64 (const char * path, __off64_t length)
#else /* __NR_truncate64 */
+libc_hidden_proto(truncate)
+
int truncate64 (const char * path, __off64_t length)
{
__off_t x = (__off_t) length;
@@ -82,4 +82,3 @@ int truncate64 (const char * path, __off64_t length)
#endif /* __NR_truncate64 */
#endif /* __UCLIBC_HAS_LFS__ */
-
diff --git a/libc/sysdeps/linux/common/ulimit.c b/libc/sysdeps/linux/common/ulimit.c
index b8e09fc8f..64bb45515 100644
--- a/libc/sysdeps/linux/common/ulimit.c
+++ b/libc/sysdeps/linux/common/ulimit.c
@@ -18,10 +18,6 @@
*
*/
-#define sysconf __sysconf
-#define getrlimit __getrlimit
-#define setrlimit __setrlimit
-
#define _GNU_SOURCE
#define _LARGEFILE64_SOURCE
#include <features.h>
@@ -48,6 +44,10 @@ _syscall2(long, ulimit, int, cmd, int, arg);
#include <errno.h>
#include <sys/resource.h>
+libc_hidden_proto(sysconf)
+libc_hidden_proto(getrlimit)
+libc_hidden_proto(setrlimit)
+
long int ulimit(int cmd, ...)
{
va_list va;
diff --git a/libc/sysdeps/linux/common/uname.c b/libc/sysdeps/linux/common/uname.c
index 3d252edc7..936b862c0 100644
--- a/libc/sysdeps/linux/common/uname.c
+++ b/libc/sysdeps/linux/common/uname.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <sys/utsname.h>
-#define __NR___uname __NR_uname
-attribute_hidden _syscall1(int, __uname, struct utsname *, buf);
-strong_alias(__uname,uname)
+_syscall1(int, uname, struct utsname *, buf);
+libc_hidden_proto(uname)
+libc_hidden_def(uname)
diff --git a/libc/sysdeps/linux/common/unlink.c b/libc/sysdeps/linux/common/unlink.c
index 4d9c3cda9..37c145226 100644
--- a/libc/sysdeps/linux/common/unlink.c
+++ b/libc/sysdeps/linux/common/unlink.c
@@ -9,6 +9,6 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___unlink __NR_unlink
-attribute_hidden _syscall1(int, __unlink, const char *, pathname);
-strong_alias(__unlink,unlink)
+_syscall1(int, unlink, const char *, pathname);
+libc_hidden_proto(unlink)
+libc_hidden_def(unlink)
diff --git a/libc/sysdeps/linux/common/utime.c b/libc/sysdeps/linux/common/utime.c
index 8087863f7..a01da3697 100644
--- a/libc/sysdeps/linux/common/utime.c
+++ b/libc/sysdeps/linux/common/utime.c
@@ -7,18 +7,18 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-#define utimes __utimes
-#define gettimeofday __gettimeofday
-
#include "syscalls.h"
#include <utime.h>
#ifdef __NR_utime
-#define __NR___utime __NR_utime
-attribute_hidden _syscall2(int, __utime, const char *, file, const struct utimbuf *, times);
+attribute_hidden _syscall2(int, utime, const char *, file, const struct utimbuf *, times);
#else
#include <stdlib.h>
#include <sys/time.h>
-int attribute_hidden __utime(const char *file, const struct utimbuf *times)
+
+libc_hidden_proto(utimes)
+libc_hidden_proto(gettimeofday)
+
+int utime(const char *file, const struct utimbuf *times)
{
struct timeval timevals[2];
@@ -36,4 +36,5 @@ int attribute_hidden __utime(const char *file, const struct utimbuf *times)
return utimes(file, timevals);
}
#endif
-strong_alias(__utime,utime)
+libc_hidden_proto(utime)
+libc_hidden_def(utime)
diff --git a/libc/sysdeps/linux/common/utimes.c b/libc/sysdeps/linux/common/utimes.c
index ca45204c7..4dfcfb30a 100644
--- a/libc/sysdeps/linux/common/utimes.c
+++ b/libc/sysdeps/linux/common/utimes.c
@@ -7,17 +7,17 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
-#define utime __utime
-
#include "syscalls.h"
#include <utime.h>
#ifdef __NR_utimes
-#define __NR___utimes __NR_utimes
-attribute_hidden _syscall2(int, __utimes, const char *, file, const struct timeval *, tvp);
+_syscall2(int, utimes, const char *, file, const struct timeval *, tvp);
#else
#include <stdlib.h>
#include <sys/time.h>
-int attribute_hidden __utimes(const char *file, const struct timeval tvp[2])
+
+libc_hidden_proto(utime)
+
+int utimes(const char *file, const struct timeval tvp[2])
{
struct utimbuf buf, *times;
@@ -31,4 +31,5 @@ int attribute_hidden __utimes(const char *file, const struct timeval tvp[2])
return utime(file, times);
}
#endif
-strong_alias(__utimes,utimes)
+libc_hidden_proto(utimes)
+libc_hidden_def(utimes)
diff --git a/libc/sysdeps/linux/common/vfork.c b/libc/sysdeps/linux/common/vfork.c
index d0a4d9a0e..df00b27c3 100644
--- a/libc/sysdeps/linux/common/vfork.c
+++ b/libc/sysdeps/linux/common/vfork.c
@@ -2,10 +2,11 @@
#include <unistd.h>
#include <sys/types.h>
-extern __pid_t __fork (void) __THROW attribute_hidden;
+libc_hidden_proto(fork)
-pid_t attribute_hidden __vfork(void)
+pid_t vfork(void)
{
- return __fork();
+ return fork();
}
-strong_alias(__vfork,vfork)
+libc_hidden_proto(vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/common/wait.c b/libc/sysdeps/linux/common/wait.c
index b2a6d2295..471650e04 100644
--- a/libc/sysdeps/linux/common/wait.c
+++ b/libc/sysdeps/linux/common/wait.c
@@ -1,4 +1,8 @@
-#define wait4 __wait4
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <stdlib.h>
#include <syscall.h>
@@ -6,10 +10,12 @@
#include <sys/wait.h>
#include <sys/resource.h>
+libc_hidden_proto(wait4)
+
/* Wait for a child to die. When one does, put its status in *STAT_LOC
* and return its process ID. For errors, return (pid_t) -1. */
-__pid_t wait (__WAIT_STATUS_DEFN stat_loc)
+__pid_t __libc_wait (__WAIT_STATUS_DEFN stat_loc)
{
- return __wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
+ return wait4 (WAIT_ANY, stat_loc, 0, (struct rusage *) NULL);
}
-weak_alias(wait,__libc_wait)
+strong_alias(__libc_wait,wait)
diff --git a/libc/sysdeps/linux/common/wait3.c b/libc/sysdeps/linux/common/wait3.c
index 4b4d6aef1..5de975c25 100644
--- a/libc/sysdeps/linux/common/wait3.c
+++ b/libc/sysdeps/linux/common/wait3.c
@@ -1,10 +1,15 @@
-#define wait4 __wait4
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/resource.h>
+libc_hidden_proto(wait4)
/* Wait for a child to exit. When one does, put its status in *STAT_LOC and
* return its process ID. For errors return (pid_t) -1. If USAGE is not nil,
diff --git a/libc/sysdeps/linux/common/wait4.c b/libc/sysdeps/linux/common/wait4.c
index b5a2c5933..9acca8ff8 100644
--- a/libc/sysdeps/linux/common/wait4.c
+++ b/libc/sysdeps/linux/common/wait4.c
@@ -14,8 +14,9 @@
static inline _syscall4(int, __syscall_wait4, __kernel_pid_t, pid,
int *, status, int, opts, struct rusage *, rusage);
-pid_t attribute_hidden __wait4(pid_t pid, int *status, int opts, struct rusage *rusage)
+pid_t wait4(pid_t pid, int *status, int opts, struct rusage *rusage)
{
return (__syscall_wait4(pid, status, opts, rusage));
}
-strong_alias(__wait4,wait4)
+libc_hidden_proto(wait4)
+libc_hidden_def(wait4)
diff --git a/libc/sysdeps/linux/common/waitpid.c b/libc/sysdeps/linux/common/waitpid.c
index 612917fcf..aeeafc7c5 100644
--- a/libc/sysdeps/linux/common/waitpid.c
+++ b/libc/sysdeps/linux/common/waitpid.c
@@ -1,4 +1,8 @@
-#define wait4 __wait4
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
#include <stdlib.h>
#include <sys/types.h>
@@ -6,9 +10,12 @@
#include <sys/wait.h>
#include <sys/resource.h>
-__pid_t attribute_hidden __waitpid(__pid_t pid, int *wait_stat, int options)
+libc_hidden_proto(wait4)
+
+__pid_t __libc_waitpid(__pid_t pid, int *wait_stat, int options)
{
- return __wait4(pid, wait_stat, options, NULL);
+ return wait4(pid, wait_stat, options, NULL);
}
-strong_alias(__waitpid,waitpid)
-weak_alias(__waitpid,__libc_waitpid)
+strong_alias(__libc_waitpid,waitpid)
+libc_hidden_proto(waitpid)
+libc_hidden_def(waitpid)
diff --git a/libc/sysdeps/linux/common/write.c b/libc/sysdeps/linux/common/write.c
index 8a1d57a82..814e68cc6 100644
--- a/libc/sysdeps/linux/common/write.c
+++ b/libc/sysdeps/linux/common/write.c
@@ -10,12 +10,13 @@
#include "syscalls.h"
#include <unistd.h>
-#define __NR___write __NR_write
-attribute_hidden _syscall3(ssize_t, __write, int, fd, const __ptr_t, buf, size_t, count);
-strong_alias(__write,write)
-weak_alias(__write,__libc_write)
+#define __NR___libc_write __NR_write
+_syscall3(ssize_t, __libc_write, int, fd, const __ptr_t, buf, size_t, count);
+strong_alias(__libc_write,write)
+libc_hidden_proto(write)
+libc_hidden_def(write)
#if 0
/* Stupid libgcc.a from gcc 2.95.x uses __write in pure.o
* which is a blatent GNU libc-ism... */
-weak_alias(__libc_write, __write)
+strong_alias(__libc_write,__write)
#endif
diff --git a/libc/sysdeps/linux/cris/brk.c b/libc/sysdeps/linux/cris/brk.c
index 10965d3b9..8b5aa680c 100644
--- a/libc/sysdeps/linux/cris/brk.c
+++ b/libc/sysdeps/linux/cris/brk.c
@@ -7,7 +7,7 @@ extern void * __curbrk;
extern int __init_brk (void);
-int attribute_hidden __brk(void * end_data_seg)
+int brk(void * end_data_seg)
{
if (__init_brk () == 0) {
/*
@@ -29,4 +29,5 @@ int attribute_hidden __brk(void * end_data_seg)
return -1;
}
-strong_alias(__brk,brk)
+libc_hidden_proto(brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/cris/clone.S b/libc/sysdeps/linux/cris/clone.S
index 19ba71996..046073b58 100644
--- a/libc/sysdeps/linux/cris/clone.S
+++ b/libc/sysdeps/linux/cris/clone.S
@@ -25,7 +25,7 @@
.syntax no_register_prefix
.text
-ENTRY (__clone)
+ENTRY (clone)
/* Sanity check arguments: No NULL function pointers. Allow a NULL
stack pointer though; it makes the kernel allocate stack. */
test.d r10
@@ -69,7 +69,7 @@ ENTRY (__clone)
jsr r0
SETUP_PIC
- PLTCALL (_exit_internal)
+ PLTCALL (HIDDEN_JUMPTARGET(_exit))
/* Die horribly. */
test.d [6809]
@@ -83,7 +83,4 @@ ENTRY (__clone)
1:
movs.w -EINVAL,r10
/* Drop through into the ordinary error handler. */
-PSEUDO_END (__clone)
-
-.globl clone
- clone = __clone
+PSEUDO_END (clone)
diff --git a/libc/sysdeps/linux/cris/fork.c b/libc/sysdeps/linux/cris/fork.c
index 4dd8e0269..11b546127 100644
--- a/libc/sysdeps/linux/cris/fork.c
+++ b/libc/sysdeps/linux/cris/fork.c
@@ -8,4 +8,6 @@ SYSCALL__ (__libc_fork, 0)
R0&-1==R0, and the child gets R0&0==0. */
/* i dunno what the blurb above is useful for. we just return. */
__asm__("ret\n\tnop");
-weak_alias(__libc_fork, fork)
+strong_alias(__libc_fork,fork)
+libc_hidden_proto(fork)
+libc_hidden_def(fork)
diff --git a/libc/sysdeps/linux/cris/sbrk.c b/libc/sysdeps/linux/cris/sbrk.c
index 3683435bf..9eb9a2a0e 100644
--- a/libc/sysdeps/linux/cris/sbrk.c
+++ b/libc/sysdeps/linux/cris/sbrk.c
@@ -9,8 +9,8 @@ extern void * __curbrk;
extern int __init_brk (void);
-void attribute_hidden *
-__sbrk(intptr_t increment)
+void *
+sbrk(intptr_t increment)
{
if (__init_brk () == 0) {
void * tmp = __curbrk + increment;
@@ -34,4 +34,5 @@ __sbrk(intptr_t increment)
}
return ((void *) -1);
}
-strong_alias(__sbrk,sbrk)
+libc_hidden_proto(sbrk)
+libc_hidden_def(sbrk)
diff --git a/libc/sysdeps/linux/cris/setjmp.S b/libc/sysdeps/linux/cris/setjmp.S
index a5ea0e2d8..2d959cbed 100644
--- a/libc/sysdeps/linux/cris/setjmp.S
+++ b/libc/sysdeps/linux/cris/setjmp.S
@@ -65,12 +65,3 @@ weak_extern (__setjmp)
weak_extern (_setjmp)
weak_extern (setjmp)
*/
-
-
-
-
-
-
-
-
-
diff --git a/libc/sysdeps/linux/e1/longjmp.c b/libc/sysdeps/linux/e1/longjmp.c
index 89d6b76d9..306638937 100644
--- a/libc/sysdeps/linux/e1/longjmp.c
+++ b/libc/sysdeps/linux/e1/longjmp.c
@@ -40,10 +40,12 @@ void longjmp(jmp_buf state, int value )
#undef _state_
}
+libc_hidden_proto(sigprocmask)
+
void siglongjmp(sigjmp_buf state, int value )
{
if( state->__mask_was_saved )
- __sigprocmask(SIG_SETMASK, &state->__saved_mask, NULL);
+ sigprocmask(SIG_SETMASK, &state->__saved_mask, NULL);
if(!value)
state->__jmpbuf->ReturnValue = 1;
diff --git a/libc/sysdeps/linux/frv/brk.c b/libc/sysdeps/linux/frv/brk.c
index d6063fc27..443c03b25 100644
--- a/libc/sysdeps/linux/frv/brk.c
+++ b/libc/sysdeps/linux/frv/brk.c
@@ -9,7 +9,7 @@ extern void * __curbrk;
extern int __init_brk (void);
extern void *_brk(void *ptr) attribute_hidden;
-int attribute_hidden __brk(void * end_data_seg)
+int brk(void * end_data_seg)
{
if (__init_brk () == 0)
{
@@ -20,4 +20,5 @@ int attribute_hidden __brk(void * end_data_seg)
}
return -1;
}
-strong_alias(__brk,brk)
+libc_hidden_proto(brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/frv/clone.S b/libc/sysdeps/linux/frv/clone.S
index b714b45b1..eff281499 100644
--- a/libc/sysdeps/linux/frv/clone.S
+++ b/libc/sysdeps/linux/frv/clone.S
@@ -25,10 +25,10 @@
#include <bits/errno.h>
.text
- .globl __clone
- .type __clone,@function
+ .globl clone
+ .type clone,@function
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
-__clone:
+clone:
/* Sanity check arguments. */
cmp.p gr8, gr0, icc0
cmp gr9, gr0, icc1
@@ -75,11 +75,8 @@ __clone:
breakpoints work.*/
mov.p gr17, gr15
- call _exit_internal
+ call HIDDEN_JUMPTARGET(_exit)
/* Should never get here. */
jmpl @(gr0, gr0)
- .size __clone,.-__clone
-
-.weak clone
- clone = __clone
+ .size clone,.-clone
diff --git a/libc/sysdeps/linux/frv/fstat.c b/libc/sysdeps/linux/frv/fstat.c
index ce6b68e66..bf031bbbc 100644
--- a/libc/sysdeps/linux/frv/fstat.c
+++ b/libc/sysdeps/linux/frv/fstat.c
@@ -41,5 +41,7 @@
#include <bits/stat.h>
#define __NR___syscall_fstat __NR_fstat
-_syscall2(int, __syscall_fstat, int, fd, struct stat *, buf);
-strong_alias(__syscall_fstat, fstat)
+attribute_hidden _syscall2(int, __syscall_fstat, int, fd, struct stat *, buf);
+strong_alias(__syscall_fstat,fstat)
+libc_hidden_proto(fstat)
+libc_hidden_def(fstat)
diff --git a/libc/sysdeps/linux/frv/fstat64.c b/libc/sysdeps/linux/frv/fstat64.c
index 27000bf83..744c5915a 100644
--- a/libc/sysdeps/linux/frv/fstat64.c
+++ b/libc/sysdeps/linux/frv/fstat64.c
@@ -42,6 +42,8 @@
#if defined __UCLIBC_HAS_LFS__
#define __NR___syscall_fstat64 __NR_fstat64
-_syscall2(int, __syscall_fstat64, int, fd, struct stat64 *, buf);
-strong_alias(__syscall_fstat64, fstat64)
+attribute_hidden _syscall2(int, __syscall_fstat64, int, fd, struct stat64 *, buf);
+strong_alias(__syscall_fstat64,fstat64)
+libc_hidden_proto(fstat64)
+libc_hidden_def(fstat64)
#endif
diff --git a/libc/sysdeps/linux/frv/lstat.c b/libc/sysdeps/linux/frv/lstat.c
index b9f0350c4..63c547c1b 100644
--- a/libc/sysdeps/linux/frv/lstat.c
+++ b/libc/sysdeps/linux/frv/lstat.c
@@ -41,5 +41,7 @@
#include <bits/stat.h>
#define __NR___syscall_lstat __NR_lstat
-_syscall2(int, __syscall_lstat, const char *, file_name, struct stat *, buf);
-strong_alias(__syscall_lstat, lstat)
+attribute_hidden _syscall2(int, __syscall_lstat, const char *, file_name, struct stat *, buf);
+strong_alias(__syscall_lstat,lstat)
+libc_hidden_proto(lstat)
+libc_hidden_def(lstat)
diff --git a/libc/sysdeps/linux/frv/lstat64.c b/libc/sysdeps/linux/frv/lstat64.c
index 8f9413a8d..ea8abf892 100644
--- a/libc/sysdeps/linux/frv/lstat64.c
+++ b/libc/sysdeps/linux/frv/lstat64.c
@@ -42,6 +42,8 @@
#if defined __UCLIBC_HAS_LFS__
#define __NR___syscall_lstat64 __NR_lstat64
-_syscall2(int, __syscall_lstat64, const char *, file_name, struct stat64 *, buf);
-strong_alias(__syscall_lstat64, lstat64)
+attribute_hidden _syscall2(int, __syscall_lstat64, const char *, file_name, struct stat64 *, buf);
+strong_alias(__syscall_lstat64,lstat64)
+libc_hidden_proto(lstat64)
+libc_hidden_def(lstat64)
#endif
diff --git a/libc/sysdeps/linux/frv/mmap.c b/libc/sysdeps/linux/frv/mmap.c
index fa801bb5f..01dcfb627 100644
--- a/libc/sysdeps/linux/frv/mmap.c
+++ b/libc/sysdeps/linux/frv/mmap.c
@@ -38,7 +38,7 @@ static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr,
# define MMAP2_PAGE_SHIFT 12
# endif
-__ptr_t attribute_hidden __mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
{
if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) {
__set_errno (EINVAL);
@@ -46,4 +46,5 @@ __ptr_t attribute_hidden __mmap(__ptr_t addr, size_t len, int prot, int flags, i
}
return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
}
-strong_alias(__mmap,mmap)
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/frv/sbrk.c b/libc/sysdeps/linux/frv/sbrk.c
index e9faf7db0..7ccefdf58 100644
--- a/libc/sysdeps/linux/frv/sbrk.c
+++ b/libc/sysdeps/linux/frv/sbrk.c
@@ -9,8 +9,8 @@ extern void * __curbrk;
extern int __init_brk (void);
extern void *_brk(void *ptr) attribute_hidden;
-void attribute_hidden *
-__sbrk(intptr_t increment)
+void *
+sbrk(intptr_t increment)
{
if (__init_brk () == 0)
{
@@ -23,4 +23,5 @@ __sbrk(intptr_t increment)
}
return ((void *) -1);
}
-strong_alias(__sbrk,sbrk)
+libc_hidden_proto(sbrk)
+libc_hidden_def(sbrk)
diff --git a/libc/sysdeps/linux/frv/stat.c b/libc/sysdeps/linux/frv/stat.c
index 4a54b130f..0d531e998 100644
--- a/libc/sysdeps/linux/frv/stat.c
+++ b/libc/sysdeps/linux/frv/stat.c
@@ -41,5 +41,7 @@
#include <bits/stat.h>
#define __NR___syscall_stat __NR_stat
-_syscall2(int, __syscall_stat, const char *, file_name, struct stat *, buf);
-strong_alias(__syscall_stat, stat)
+attribute_hidden _syscall2(int, __syscall_stat, const char *, file_name, struct stat *, buf);
+strong_alias(__syscall_stat,stat)
+libc_hidden_proto(stat)
+libc_hidden_def(stat)
diff --git a/libc/sysdeps/linux/frv/stat64.c b/libc/sysdeps/linux/frv/stat64.c
index ecfe808cc..3c702d885 100644
--- a/libc/sysdeps/linux/frv/stat64.c
+++ b/libc/sysdeps/linux/frv/stat64.c
@@ -42,6 +42,8 @@
#if defined __UCLIBC_HAS_LFS__
#define __NR___syscall_stat64 __NR_stat64
-_syscall2(int, __syscall_stat64, const char *, file_name, struct stat64 *, buf);
-strong_alias(__syscall_stat64, stat64)
+attribute_hidden _syscall2(int, __syscall_stat64, const char *, file_name, struct stat64 *, buf);
+strong_alias(__syscall_stat64,stat64)
+libc_hidden_proto(stat64)
+libc_hidden_def(stat64)
#endif
diff --git a/libc/sysdeps/linux/frv/vfork.S b/libc/sysdeps/linux/frv/vfork.S
index b5ecc09af..9a70e22ac 100644
--- a/libc/sysdeps/linux/frv/vfork.S
+++ b/libc/sysdeps/linux/frv/vfork.S
@@ -24,11 +24,10 @@
#include <bits/errno.h>
.text
- .globl __vfork
- .hidden __vfork
- .type __vfork,@function
+ .globl vfork
+ .type vfork,@function
/* int vfork(void) */
-__vfork:
+vfork:
setlos.p #__NR_vfork, gr7
setlos #-4096, gr4
tra gr0, gr0
@@ -41,6 +40,6 @@ __vfork:
ldd @(gr14, gr15), gr14
jmpl @(gr14, gr0)
- .size __vfork,.-__vfork
+ .size vfork,.-vfork
-strong_alias(__vfork,vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/h8300/brk.c b/libc/sysdeps/linux/h8300/brk.c
index d69f9a2d3..0bba5de99 100644
--- a/libc/sysdeps/linux/h8300/brk.c
+++ b/libc/sysdeps/linux/h8300/brk.c
@@ -9,7 +9,7 @@
void *__curbrk = 0;
-int attribute_hidden __brk (void *addr)
+int brk (void *addr)
{
void *newbrk;
@@ -31,4 +31,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/h8300/clone.S b/libc/sysdeps/linux/h8300/clone.S
index 7d100b6c4..554a29703 100644
--- a/libc/sysdeps/linux/h8300/clone.S
+++ b/libc/sysdeps/linux/h8300/clone.S
@@ -19,9 +19,7 @@
.text
.globl _clone
-.globl ___clone
_clone:
-___clone:
/* Sanity check arguments. */
mov.l #-EINVAL,er3
mov.l er0,er0 /* no NULL function pointers */
@@ -68,11 +66,3 @@ thread_start:
mov.l er0,er1
mov.l #__NR_exit,er0
trapa #0
-
-#if defined(__HAVE_ELF__)
- .weak clone
- clone = __clone
-#else
- .set clone,__clone
-#endif
-
diff --git a/libc/sysdeps/linux/h8300/vfork.S b/libc/sysdeps/linux/h8300/vfork.S
index e101bf5ed..94e946912 100644
--- a/libc/sysdeps/linux/h8300/vfork.S
+++ b/libc/sysdeps/linux/h8300/vfork.S
@@ -38,3 +38,4 @@ fix_errno:
dec.l #1,er0
jmp @er1 /* don't return, just jmp directly */
+libc_hidden_def(_vork)
diff --git a/libc/sysdeps/linux/hppa/__longjmp.S b/libc/sysdeps/linux/hppa/__longjmp.S
index 62026635f..750863e95 100644
--- a/libc/sysdeps/linux/hppa/__longjmp.S
+++ b/libc/sysdeps/linux/hppa/__longjmp.S
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <features.h>
#define _SETJMP_H
#define _ASM
#include <bits/setjmp.h>
@@ -69,3 +70,5 @@ __longjmp:
bv,n %r0(%r2)
.procend
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/hppa/brk.c b/libc/sysdeps/linux/hppa/brk.c
index f50360aa5..0ac8236c8 100644
--- a/libc/sysdeps/linux/hppa/brk.c
+++ b/libc/sysdeps/linux/hppa/brk.c
@@ -23,8 +23,8 @@
/* 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;
@@ -38,4 +38,5 @@ __brk (void *addr)
return 0;
}
-strong_alias(__brk,brk)
+libc_hidden_proto(brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/hppa/clone.S b/libc/sysdeps/linux/hppa/clone.S
index 8395cdada..f6e5568d0 100644
--- a/libc/sysdeps/linux/hppa/clone.S
+++ b/libc/sysdeps/linux/hppa/clone.S
@@ -29,9 +29,9 @@
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
.text
-.global __clone
-.type __clone,%function
-__clone:
+.global clone
+.type clone,%function
+clone:
/* FIXME: I have no idea how profiling works on hppa. */
/* Sanity check arguments. */
@@ -90,13 +90,10 @@ thread_start:
bl $$dyncall,%r31
copy %r31,%rp
- bl _exit_internal,%rp
+ bl HIDDEN_JUMPTARGET(_exit),%rp
copy %ret0,%arg0
/* Die horribly. */
iitlbp %r0,(%r0)
-.size __clone,.-__clone
-
-.weak clone
- clone = __clone
+.size clone,.-clone
diff --git a/libc/sysdeps/linux/hppa/mmap.c b/libc/sysdeps/linux/hppa/mmap.c
index f14f1b6f9..b69f0a2f2 100644
--- a/libc/sysdeps/linux/hppa/mmap.c
+++ b/libc/sysdeps/linux/hppa/mmap.c
@@ -13,7 +13,7 @@
#include <sys/mman.h>
#include <sys/syscall.h>
-#define __NR___mmap __NR_mmap
-attribute_hidden _syscall6(void *, __mmap, void *, start, size_t, length, int, prot,
+_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
int, flags, int, fd, off_t, offset);
-strong_alias(__mmap,mmap)
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/i386/__longjmp.S b/libc/sysdeps/linux/i386/__longjmp.S
index 52f53bb68..d73a7cda2 100644
--- a/libc/sysdeps/linux/i386/__longjmp.S
+++ b/libc/sysdeps/linux/i386/__longjmp.S
@@ -17,6 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <features.h>
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
@@ -38,3 +39,5 @@ __longjmp:
/* Jump to saved PC. */
jmp *%edx
.size __longjmp,.-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/i386/brk.c b/libc/sysdeps/linux/i386/brk.c
index 5790e2fca..cf7e19be8 100644
--- a/libc/sysdeps/linux/i386/brk.c
+++ b/libc/sysdeps/linux/i386/brk.c
@@ -25,7 +25,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 *__unbounded newbrk, *__unbounded scratch;
@@ -46,4 +46,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/i386/clone.S b/libc/sysdeps/linux/i386/clone.S
index 35a4e5b7f..14fc25ca1 100644
--- a/libc/sysdeps/linux/i386/clone.S
+++ b/libc/sysdeps/linux/i386/clone.S
@@ -42,9 +42,9 @@
#define CTID TLS+PTR_SIZE
.text
-.global __clone
-.type __clone,%function
-__clone:
+.global clone
+.type clone,%function
+clone:
/* Sanity check arguments. */
movl $-EINVAL,%eax
@@ -120,7 +120,4 @@ __clone:
__error:
jmp __syscall_error
-.size __clone,.-__clone
-
-.weak clone
- clone = __clone
+.size clone,.-clone
diff --git a/libc/sysdeps/linux/i386/mmap.S b/libc/sysdeps/linux/i386/mmap.S
index 4c4723dff..fe7a7986c 100644
--- a/libc/sysdeps/linux/i386/mmap.S
+++ b/libc/sysdeps/linux/i386/mmap.S
@@ -21,13 +21,10 @@
#include <bits/errno.h>
#include <sys/syscall.h>
-.global mmap
-.set mmap,__mmap
.text
-.global __mmap
-.hidden __mmap
-.type __mmap,%function
-__mmap:
+.global mmap
+.type mmap,%function
+mmap:
/* Save registers. */
movl %ebx, %edx
@@ -49,4 +46,6 @@ __mmap:
/* Successful; return the syscall's value. */
ret
-.size __mmap,.-__mmap
+.size mmap,.-mmap
+
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/i386/sigaction.c b/libc/sysdeps/linux/i386/sigaction.c
index 335fc9a27..e3162ab46 100644
--- a/libc/sysdeps/linux/i386/sigaction.c
+++ b/libc/sysdeps/linux/i386/sigaction.c
@@ -29,6 +29,8 @@
#if defined __NR_rt_sigaction
+libc_hidden_proto(memcpy)
+
extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
extern void restore (void) asm ("__restore") attribute_hidden;
@@ -48,7 +50,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 (kact.sa_mask));
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
kact.sa_flags = act->sa_flags;
kact.sa_flags = act->sa_flags | SA_RESTORER;
@@ -63,7 +65,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa
if (oact && result >= 0) {
oact->sa_handler = koact.k_sa_handler;
- __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
oact->sa_flags = koact.sa_flags;
oact->sa_restorer = koact.sa_restorer;
}
@@ -121,8 +123,9 @@ 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/i386/vfork.S b/libc/sysdeps/linux/i386/vfork.S
index 18a8e5dfa..1f0e9d8ab 100644
--- a/libc/sysdeps/linux/i386/vfork.S
+++ b/libc/sysdeps/linux/i386/vfork.S
@@ -9,18 +9,17 @@
#ifndef __NR_vfork
/* No vfork so use fork instead */
-hidden_strong_alias(__fork,__vfork)
-weak_alias(vfork,__libc_fork)
+strong_alias(fork,vfork)
+strong_alias(vfork,__libc_fork)
#else
.text
-.global __vfork
-.hidden __vfork
-.type __vfork,%function
+.global vfork
+.type vfork,%function
.align 1<<4
-__vfork:
+vfork:
popl %ecx
movl $__NR_vfork,%eax
int $0x80
@@ -29,6 +28,6 @@ __vfork:
jae __syscall_error
ret
-.size __vfork,.-__vfork
+.size vfork,.-vfork
#endif
-strong_alias(__vfork,vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/m68k/__longjmp.S b/libc/sysdeps/linux/m68k/__longjmp.S
index d218f2ef5..81079f48c 100644
--- a/libc/sysdeps/linux/m68k/__longjmp.S
+++ b/libc/sysdeps/linux/m68k/__longjmp.S
@@ -22,3 +22,4 @@ __longjmp:
movel %a0@(JB_PC), %sp@
rts
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/m68k/brk.c b/libc/sysdeps/linux/m68k/brk.c
index 4c33549cc..5204c7493 100644
--- a/libc/sysdeps/linux/m68k/brk.c
+++ b/libc/sysdeps/linux/m68k/brk.c
@@ -7,7 +7,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 +28,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/m68k/clone.S b/libc/sysdeps/linux/m68k/clone.S
index 916488146..1c4176c3f 100644
--- a/libc/sysdeps/linux/m68k/clone.S
+++ b/libc/sysdeps/linux/m68k/clone.S
@@ -13,9 +13,9 @@
.text
.align 4
-.type __clone,@function
-.globl __clone;
-__clone:
+.type clone,@function
+.globl clone;
+clone:
/* Sanity check arguments. */
movel #-EINVAL, %d0
movel 4(%sp), %d1 /* no NULL function pointers */
@@ -73,10 +73,3 @@ thread_start:
movel #__NR_exit, %d0
trap #0
/*jsr exit*/
-
-#if defined(__HAVE_ELF__)
- .weak clone
- clone = __clone
-#else
- .set clone,__clone
-#endif
diff --git a/libc/sysdeps/linux/m68k/vfork.S b/libc/sysdeps/linux/m68k/vfork.S
index e58b9e949..d5e26ddd2 100644
--- a/libc/sysdeps/linux/m68k/vfork.S
+++ b/libc/sysdeps/linux/m68k/vfork.S
@@ -11,13 +11,12 @@
.text
.align 2
.globl errno
- .globl __vfork
+ .globl vfork
#ifdef __HAVE_ELF__
- .hidden __vfork
- .type __vfork,@function
+ .type vfork,@function
#endif
-__vfork:
+vfork:
movl %sp@+, %a1 /* save the return address for later */
movl IMM __NR_vfork,%d0
trap #0
@@ -36,5 +35,5 @@ fix_errno:
movl IMM -1, %d0
jmp %a1@ /* don't return, just jmp directly */
-.size __vfork,.-__vfork
-strong_alias(__vfork,vfork)
+.size vfork,.-vfork
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/microblaze/__longjmp.S b/libc/sysdeps/linux/microblaze/__longjmp.S
index e87a6f6a3..a58418ae9 100644
--- a/libc/sysdeps/linux/microblaze/__longjmp.S
+++ b/libc/sysdeps/linux/microblaze/__longjmp.S
@@ -45,3 +45,5 @@ C_END(__longjmp)
.weak C_SYMBOL_NAME(__sigprocmask)
C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/microblaze/longjmp.S b/libc/sysdeps/linux/microblaze/longjmp.S
index 2d9adebe5..1d0b9b2b6 100644
--- a/libc/sysdeps/linux/microblaze/longjmp.S
+++ b/libc/sysdeps/linux/microblaze/longjmp.S
@@ -51,3 +51,5 @@ C_SYMBOL_NAME(siglongjmp) = C_SYMBOL_NAME(__longjmp)
.weak C_SYMBOL_NAME(__sigprocmask)
C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/microblaze/mmap.c b/libc/sysdeps/linux/microblaze/mmap.c
index fbfcca3a8..592161789 100644
--- a/libc/sysdeps/linux/microblaze/mmap.c
+++ b/libc/sysdeps/linux/microblaze/mmap.c
@@ -7,3 +7,5 @@
_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
int, flags, int, fd, __off_t, offset);
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/microblaze/vfork.S b/libc/sysdeps/linux/microblaze/vfork.S
index e264d36f9..b641fedf1 100644
--- a/libc/sysdeps/linux/microblaze/vfork.S
+++ b/libc/sysdeps/linux/microblaze/vfork.S
@@ -27,7 +27,7 @@
.global C_SYMBOL_NAME(errno)
-C_ENTRY (__vfork):
+C_ENTRY (vfork):
addi r12, r0, SYS_vfork
bralid r17, 0x08;
nop
@@ -39,7 +39,6 @@ C_ENTRY (__vfork):
swi r3, r0, C_SYMBOL_NAME(errno);
rtsd r15, 8 // error return
nop
-C_END(__vfork)
+C_END(vfork)
-.weak C_SYMBOL_NAME(vfork)
-C_SYMBOL_NAME(vfork) = C_SYMBOL_NAME(__vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/mips/__longjmp.c b/libc/sysdeps/linux/mips/__longjmp.c
index 5be2e974b..fb042218b 100644
--- a/libc/sysdeps/linux/mips/__longjmp.c
+++ b/libc/sysdeps/linux/mips/__longjmp.c
@@ -82,3 +82,5 @@ void __longjmp (__jmp_buf env, int val_arg)
/* Avoid `volatile function does return' warnings. */
for (;;);
}
+libc_hidden_proto(__longjmp)
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/mips/brk.c b/libc/sysdeps/linux/mips/brk.c
index ba6765ca7..29479f621 100644
--- a/libc/sysdeps/linux/mips/brk.c
+++ b/libc/sysdeps/linux/mips/brk.c
@@ -23,7 +23,7 @@
void *__curbrk = 0;
-int attribute_hidden __brk (void *addr)
+int brk (void *addr)
{
void *newbrk;
@@ -48,4 +48,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/mips/clone.S b/libc/sysdeps/linux/mips/clone.S
index 9c12075b3..f3b3aadb2 100644
--- a/libc/sysdeps/linux/mips/clone.S
+++ b/libc/sysdeps/linux/mips/clone.S
@@ -29,12 +29,12 @@
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
.text
-.globl __clone ;
+.globl clone ;
.align 2;
- .type __clone,@function;
- .ent __clone, 0;
+ .type clone,@function;
+ .ent clone, 0;
-__clone:
+clone:
.frame sp, 4*SZREG, sp
#ifdef __PIC__
.set noreorder
@@ -106,8 +106,5 @@ __thread_start:
/* Call _exit rather than doing it inline for breakpoint purposes. */
move a0,v0
- jal _exit_internal
+ jal HIDDEN_JUMPTARGET(_exit)
.end __thread_start
-
-.weak clone;
- clone = __clone
diff --git a/libc/sysdeps/linux/mips/mmap.c b/libc/sysdeps/linux/mips/mmap.c
index 25a3ef5bd..125523eef 100644
--- a/libc/sysdeps/linux/mips/mmap.c
+++ b/libc/sysdeps/linux/mips/mmap.c
@@ -14,7 +14,7 @@
#endif
#endif
-#define __NR___mmap __NR_mmap
-attribute_hidden _syscall6 (__ptr_t, __mmap, __ptr_t, addr, size_t, len, int, prot,
+_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
int, flags, int, fd, __off_t, offset);
-strong_alias(__mmap,mmap)
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/mips/pipe.S b/libc/sysdeps/linux/mips/pipe.S
index fb8f7ef7f..b5664f791 100644
--- a/libc/sysdeps/linux/mips/pipe.S
+++ b/libc/sysdeps/linux/mips/pipe.S
@@ -8,10 +8,8 @@
#include <asm/regdef.h>
.globl pipe
- .globl __pipe
- .hidden __pipe
- .ent __pipe, 0
-__pipe:
+ .ent pipe, 0
+pipe:
addiu sp,sp,-24
sw a0,16(sp)
li v0,__NR_pipe
@@ -29,6 +27,5 @@ __pipe:
2:
addiu sp,sp,24
j ra
- .end __pipe
- .size __pipe,.-__pipe
- .weak pipe; pipe = __pipe
+ .end pipe
+ .size pipe,.-pipe
diff --git a/libc/sysdeps/linux/mips/pipe.c b/libc/sysdeps/linux/mips/pipe.c
index fbc73b489..65e335964 100644
--- a/libc/sysdeps/linux/mips/pipe.c
+++ b/libc/sysdeps/linux/mips/pipe.c
@@ -6,7 +6,7 @@
#include <unistd.h>
#include <syscall.h>
-int attribute_hidden __pipe(int *fd)
+int pipe(int *fd)
{
register long int res __asm__ ("$2"); // v0
register long int res2 __asm__ ("$3"); // v1
@@ -21,4 +21,3 @@ int attribute_hidden __pipe(int *fd)
fd[1] = res2;
return(0);
}
-strong_alias(__pipe,pipe)
diff --git a/libc/sysdeps/linux/mips/pread_write.c b/libc/sysdeps/linux/mips/pread_write.c
index 5baba30d2..4ee81d4d9 100644
--- a/libc/sysdeps/linux/mips/pread_write.c
+++ b/libc/sysdeps/linux/mips/pread_write.c
@@ -60,7 +60,7 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR(offset>>31,offset)));
}
-weak_alias (__libc_pread, pread)
+strong_alias(__libc_pread,pread)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
@@ -69,7 +69,7 @@ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
uint32_t high = offset >> 32;
return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
}
-weak_alias (__libc_pread64, pread64)
+strong_alias(__libc_pread64,pread64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* !__mips64 */
@@ -97,7 +97,7 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
return(__syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR(offset>>31,offset)));
}
-weak_alias (__libc_pwrite, pwrite)
+strong_alias(__libc_pwrite,pwrite)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
@@ -106,7 +106,7 @@ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
uint32_t high = offset >> 32;
return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
}
-weak_alias (__libc_pwrite64, pwrite64)
+strong_alias(__libc_pwrite64,pwrite64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* !__mips64 */
#endif /* __NR_pwrite */
diff --git a/libc/sysdeps/linux/mips/sigaction.c b/libc/sysdeps/linux/mips/sigaction.c
index b2982678b..5e2d6ccde 100644
--- a/libc/sysdeps/linux/mips/sigaction.c
+++ b/libc/sysdeps/linux/mips/sigaction.c
@@ -30,6 +30,8 @@
#if defined __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. */
int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
@@ -39,7 +41,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 (kact.sa_mask));
+ memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
kact.sa_flags = act->sa_flags;
# ifdef HAVE_SA_RESTORER
# if _MIPS_SIM == _ABIO32
@@ -57,7 +59,7 @@ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oa
if (oact && result >= 0) {
oact->sa_handler = koact.k_sa_handler;
- __memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
+ memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
oact->sa_flags = koact.sa_flags;
# ifdef HAVE_SA_RESTORER
oact->sa_restorer = koact.sa_restorer;
@@ -112,6 +114,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/nios/__longjmp.S b/libc/sysdeps/linux/nios/__longjmp.S
index 1b4fa6a56..d7d1cdd86 100644
--- a/libc/sysdeps/linux/nios/__longjmp.S
+++ b/libc/sysdeps/linux/nios/__longjmp.S
@@ -100,10 +100,4 @@ __longjmp_done:
jmp %o7 ; and kinda return there.
mov %o0,%g1 ; (delay slot) return value
-
-
-
-
-
-
-
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/nios/brk.c b/libc/sysdeps/linux/nios/brk.c
index 2e785b734..9c9f2d80f 100644
--- a/libc/sysdeps/linux/nios/brk.c
+++ b/libc/sysdeps/linux/nios/brk.c
@@ -25,7 +25,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;
register int g1 asm("%g1") = __NR_brk;
@@ -42,4 +42,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/nios/clone.S b/libc/sysdeps/linux/nios/clone.S
index c4799c5b2..39eb54035 100644
--- a/libc/sysdeps/linux/nios/clone.S
+++ b/libc/sysdeps/linux/nios/clone.S
@@ -28,10 +28,10 @@
.text
.align 2
- .globl __clone
- .type __clone,@function
+ .globl clone
+ .type clone,@function
-__clone:
+clone:
save %sp,-16
MOVIP %l0, -EINVAL
@@ -74,7 +74,7 @@ CLONE_ERROR_LABEL:
ret
restore
- .size __clone, .-__clone
+ .size clone, .-clone
.type __thread_start,@function
@@ -86,6 +86,3 @@ __thread_start:
nop
.size __thread_start, .-__thread_start
-
-.weak clone
- clone = __clone
diff --git a/libc/sysdeps/linux/nios/vfork.S b/libc/sysdeps/linux/nios/vfork.S
index cf95c5a34..3ac3da9b3 100644
--- a/libc/sysdeps/linux/nios/vfork.S
+++ b/libc/sysdeps/linux/nios/vfork.S
@@ -22,11 +22,11 @@
.text
.align 2
- .globl __vfork
+ .globl vfork
#if defined __HAVE_ELF__
- .type __vfork,@function
+ .type vfork,@function
#endif
-__vfork:
+vfork:
MOVIP %g1, __NR_vfork
trap 63
@@ -50,5 +50,5 @@ fix_errno:
ret
restore
-.size __vfork,.-__vfork
-strong_alias(__vfork,vfork)
+.size vfork,.-vfork
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/nios2/__longjmp.S b/libc/sysdeps/linux/nios2/__longjmp.S
index 96eeaadc0..4b6508e5d 100644
--- a/libc/sysdeps/linux/nios2/__longjmp.S
+++ b/libc/sysdeps/linux/nios2/__longjmp.S
@@ -47,3 +47,4 @@ __longjmp:
ret
.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/nios2/brk.c b/libc/sysdeps/linux/nios2/brk.c
index e5a4c5d07..921cd771b 100644
--- a/libc/sysdeps/linux/nios2/brk.c
+++ b/libc/sysdeps/linux/nios2/brk.c
@@ -26,7 +26,7 @@
void *__curbrk = 0;
-int attribute_hidden __brk (void *addr)
+int brk (void *addr)
{
void *newbrk;
register int r2 asm("r2") = TRAP_ID_SYSCALL;
@@ -44,4 +44,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/nios2/clone.S b/libc/sysdeps/linux/nios2/clone.S
index ba514c40b..4afcb7d75 100644
--- a/libc/sysdeps/linux/nios2/clone.S
+++ b/libc/sysdeps/linux/nios2/clone.S
@@ -18,10 +18,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:
addi sp,sp,-8
mov r8,r4
stw ra,4(sp)
@@ -65,9 +65,6 @@ CLONE_OK:
addi sp,sp,8
ret
-.size __clone,.-__clone
-
-.weak clone
- clone = __clone
+.size clone,.-clone
#endif
diff --git a/libc/sysdeps/linux/nios2/vfork.S b/libc/sysdeps/linux/nios2/vfork.S
index fa7ff9916..f8b3179d0 100644
--- a/libc/sysdeps/linux/nios2/vfork.S
+++ b/libc/sysdeps/linux/nios2/vfork.S
@@ -18,11 +18,10 @@
#ifdef __NR_fork
.text
-.global __vfork
-.hidden __vfork
-.type __vfork,%function
+.global vfork
+.type vfork,%function
.align 4
-__vfork:
+vfork:
movui r2, TRAP_ID_SYSCALL
movui r3, __NR_vfork
trap
@@ -48,6 +47,6 @@ fix_errno:
addi sp, sp, 8
ret
-.size __vfork,.-__vfork
-strong_alias(__vfork,vfork)
+.size vfork,.-vfork
+libc_hidden_def(vfork)
#endif
diff --git a/libc/sysdeps/linux/powerpc/__longjmp.S b/libc/sysdeps/linux/powerpc/__longjmp.S
index 874354e5a..83f094c15 100644
--- a/libc/sysdeps/linux/powerpc/__longjmp.S
+++ b/libc/sysdeps/linux/powerpc/__longjmp.S
@@ -80,3 +80,5 @@ FP( lfd fp31,((JB_FPRS+17*2)*4)(r3))
mr r3,r4
blr
.size __longjmp,.-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/powerpc/brk.S b/libc/sysdeps/linux/powerpc/brk.S
index b718c0de4..bf42784cb 100644
--- a/libc/sysdeps/linux/powerpc/brk.S
+++ b/libc/sysdeps/linux/powerpc/brk.S
@@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <features.h>
#include "ppc_asm.h"
#define _ERRNO_H 1
#include <bits/errno.h>
@@ -25,12 +26,11 @@
#ifdef __NR_brk
.comm __curbrk,4,4
.text
- .globl __brk
- .hidden __brk
- .type __brk,@function
+ .globl brk
+ .type brk,@function
.align 2
-__brk:
+brk:
stwu r1,-16(r1)
stw r3,8(r1)
li 0, __NR_brk;
@@ -55,8 +55,7 @@ __brk:
b __syscall_error
- .size __brk,.-__brk
+ .size brk,.-brk
- .weak brk
- brk=__brk
+libc_hidden_def(brk)
#endif
diff --git a/libc/sysdeps/linux/powerpc/clone.S b/libc/sysdeps/linux/powerpc/clone.S
index 9e8a1ca53..b5b4d17a2 100644
--- a/libc/sysdeps/linux/powerpc/clone.S
+++ b/libc/sysdeps/linux/powerpc/clone.S
@@ -30,11 +30,11 @@
int flags [r5], void *arg [r6]); */
#ifdef __NR_clone
- .globl __clone
- .type __clone,@function
+ .globl clone
+ .type clone,@function
.align 2
-__clone:
+clone:
/* Check for child_stack == NULL || fn == NULL. */
cmpwi cr0,r4,0
cmpwi cr1,r3,0
@@ -78,7 +78,7 @@ __clone:
mr r3,r31
bctrl
/* Call _exit with result from procedure. */
- b _exit_internal
+ b HIDDEN_JUMPTARGET(_exit)
.Lparent:
/* Parent. Restore registers & return. */
@@ -93,7 +93,5 @@ __clone:
b __syscall_error
- .size __clone,.-__clone
- .weak clone
- clone=__clone
+ .size clone,.-clone
#endif
diff --git a/libc/sysdeps/linux/powerpc/ioctl.c b/libc/sysdeps/linux/powerpc/ioctl.c
index bb8842bb6..211bb3b25 100644
--- a/libc/sysdeps/linux/powerpc/ioctl.c
+++ b/libc/sysdeps/linux/powerpc/ioctl.c
@@ -16,15 +16,15 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define tcsetattr __tcsetattr
-#define tcgetattr __tcgetattr
-
#include <stdarg.h>
#include <termios.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/syscall.h>
+libc_hidden_proto(tcsetattr)
+libc_hidden_proto(tcgetattr)
+
/* The user-visible size of struct termios has changed. Catch ioctl calls
using the new-style struct termios, and translate them to old-style. */
@@ -33,7 +33,7 @@ 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 ap;
@@ -69,4 +69,5 @@ int attribute_hidden __ioctl (int fd, unsigned long int request, ...)
return result;
}
-strong_alias(__ioctl,ioctl)
+libc_hidden_proto(ioctl)
+libc_hidden_def(ioctl)
diff --git a/libc/sysdeps/linux/powerpc/mmap.c b/libc/sysdeps/linux/powerpc/mmap.c
index cac08ba65..8003c8bbc 100644
--- a/libc/sysdeps/linux/powerpc/mmap.c
+++ b/libc/sysdeps/linux/powerpc/mmap.c
@@ -10,7 +10,7 @@
return (__sc_err & 0x10000000 ? errno = __sc_ret, __sc_ret = -1 : 0), \
(type) __sc_ret
-void attribute_hidden * __mmap(void *start, size_t length, int prot, int flags, int fd,
+void * mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset)
{
unsigned long __sc_ret, __sc_err;
@@ -45,4 +45,5 @@ void attribute_hidden * __mmap(void *start, size_t length, int prot, int flags,
__syscall_return (void *);
}
-strong_alias(__mmap,mmap)
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/powerpc/pread_write.c b/libc/sysdeps/linux/powerpc/pread_write.c
index 8115d4d01..1cf7f690b 100644
--- a/libc/sysdeps/linux/powerpc/pread_write.c
+++ b/libc/sysdeps/linux/powerpc/pread_write.c
@@ -33,7 +33,6 @@
# undef __USE_FILE_OFFSET64
#endif
-
#include <errno.h>
#include <sys/types.h>
#include <sys/syscall.h>
@@ -52,14 +51,14 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__syscall_pread(fd, buf, count, (off64_t)offset));
}
-weak_alias (__libc_pread, pread)
+strong_alias(__libc_pread,pread)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
{
return(__syscall_pread(fd, buf, count, offset));
}
-weak_alias (__libc_pread64, pread64)
+strong_alias(__libc_pread64,pread64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* __NR_pread */
@@ -73,20 +72,25 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
return(__syscall_pwrite(fd, buf, count, (off64_t)offset));
}
-weak_alias (__libc_pwrite, pwrite)
+strong_alias(__libc_pwrite,pwrite)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
{
return(__syscall_pwrite(fd, buf, count, offset));
}
-weak_alias (__libc_pwrite64, pwrite64)
+strong_alias(__libc_pwrite64,pwrite64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* __NR_pwrite */
#if ! defined __NR_pread || ! defined __NR_pwrite
+libc_hidden_proto(lseek)
+libc_hidden_proto(lseek64)
+libc_hidden_proto(read)
+libc_hidden_proto(write)
+
static ssize_t __fake_pread_write(int fd, void *buf,
size_t count, off_t offset, int do_pwrite)
{
@@ -96,11 +100,11 @@ static ssize_t __fake_pread_write(int fd, void *buf,
/* Since we must not change the file pointer preserve the
* value so that we can restore it later. */
- if ((old_offset=__lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
+ if ((old_offset=lseek(fd, 0, SEEK_CUR)) == (off_t) -1)
return -1;
/* Set to wanted position. */
- if (__lseek (fd, offset, SEEK_SET) == (off_t) -1)
+ if (lseek (fd, offset, SEEK_SET) == (off_t) -1)
return -1;
if (do_pwrite==1) {
@@ -114,7 +118,7 @@ static ssize_t __fake_pread_write(int fd, void *buf,
/* Now we have to restore the position. If this fails we
* have to return this as an error. */
save_errno = errno;
- if (__lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
+ if (lseek(fd, old_offset, SEEK_SET) == (off_t) -1)
{
if (result == -1)
__set_errno(save_errno);
@@ -134,11 +138,11 @@ static ssize_t __fake_pread_write64(int fd, void *buf,
/* Since we must not change the file pointer preserve the
* value so that we can restore it later. */
- if ((old_offset=__lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
+ if ((old_offset=lseek64(fd, 0, SEEK_CUR)) == (off64_t) -1)
return -1;
/* Set to wanted position. */
- if (__lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
+ if (lseek64(fd, offset, SEEK_SET) == (off64_t) -1)
return -1;
if (do_pwrite==1) {
@@ -151,7 +155,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf,
/* Now we have to restore the position. */
save_errno = errno;
- if (__lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) {
+ if (lseek64 (fd, old_offset, SEEK_SET) == (off64_t) -1) {
if (result == -1)
__set_errno (save_errno);
return -1;
@@ -167,14 +171,14 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__fake_pread_write(fd, buf, count, offset, 0));
}
-weak_alias (__libc_pread, pread)
+strong_alias(__libc_pread,pread)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
{
return(__fake_pread_write64(fd, buf, count, offset, 0));
}
-weak_alias (__libc_pread64, pread64)
+strong_alias(__libc_pread64,pread64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* ! __NR_pread */
@@ -184,14 +188,13 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
return(__fake_pread_write(fd, buf, count, offset, 1));
}
-weak_alias (__libc_pwrite, pwrite)
+strong_alias(__libc_pwrite,pwrite)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
{
return(__fake_pread_write64(fd, (void*)buf, count, offset, 1));
}
-weak_alias (__libc_pwrite64, pwrite64)
+strong_alias(__libc_pwrite64,pwrite64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* ! __NR_pwrite */
-
diff --git a/libc/sysdeps/linux/powerpc/vfork.S b/libc/sysdeps/linux/powerpc/vfork.S
index 7cf5eaa16..5b4bcc069 100644
--- a/libc/sysdeps/linux/powerpc/vfork.S
+++ b/libc/sysdeps/linux/powerpc/vfork.S
@@ -4,23 +4,22 @@
#ifndef __NR_vfork
/* No vfork so use fork instead */
-hidden_strong_alias(__fork,__vfork)
-weak_alias(vfork,__libc_fork)
+strong_alias(fork,vfork)
+strong_alias(vfork,__libc_fork)
#else
.text
-.global __vfork
-.hidden __vfork
-.type __vfork,@function
+.global vfork
+.type vfork,@function
.type __syscall_error,@function
-__vfork:
+vfork:
li 0, __NR_vfork
sc
bnslr+
b __syscall_error
-.size __vfork,.-__vfork
+.size vfork,.-vfork
#endif
-strong_alias(__vfork,vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/powerpc/vfork.c b/libc/sysdeps/linux/powerpc/vfork.c
index 39f992513..92e9f8d63 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 attribute_hidden __vfork(void)
+pid_t vfork(void)
{
unsigned long __sc_ret, __sc_err;
register unsigned long __sc_0 __asm__ ("r0");
@@ -46,4 +46,5 @@ pid_t attribute_hidden __vfork(void)
__syscall_return (pid_t);
}
-strong_alias(__vfork,vfork)
+libc_hidden_proto(vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/sh/__longjmp.S b/libc/sysdeps/linux/sh/__longjmp.S
index 9e310a283..a9a7cba8a 100644
--- a/libc/sysdeps/linux/sh/__longjmp.S
+++ b/libc/sysdeps/linux/sh/__longjmp.S
@@ -61,7 +61,8 @@ __longjmp:
rts
ldc.l @r4+, gbr
#endif
-.size __longjmp,.-__longjmp;
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
.weak __sigprocmask
__sigprocmask = sigprocmask
diff --git a/libc/sysdeps/linux/sh/brk.c b/libc/sysdeps/linux/sh/brk.c
index d6063fc27..443c03b25 100644
--- a/libc/sysdeps/linux/sh/brk.c
+++ b/libc/sysdeps/linux/sh/brk.c
@@ -9,7 +9,7 @@ extern void * __curbrk;
extern int __init_brk (void);
extern void *_brk(void *ptr) attribute_hidden;
-int attribute_hidden __brk(void * end_data_seg)
+int brk(void * end_data_seg)
{
if (__init_brk () == 0)
{
@@ -20,4 +20,5 @@ int attribute_hidden __brk(void * end_data_seg)
}
return -1;
}
-strong_alias(__brk,brk)
+libc_hidden_proto(brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/sh/clone.S b/libc/sysdeps/linux/sh/clone.S
index 7824d4771..80c623b81 100644
--- a/libc/sysdeps/linux/sh/clone.S
+++ b/libc/sysdeps/linux/sh/clone.S
@@ -38,9 +38,9 @@
.text
.align 4
-.type __clone,@function
-.globl __clone;
-__clone:
+.type clone,@function
+.globl clone;
+clone:
/* sanity check arguments. */
tst r4, r4
bt 0f
@@ -118,10 +118,7 @@ __clone:
#endif
.align 2
.L1:
- .long PLTJMP(_exit_internal)
-.size __clone,.-__clone;
-
-.globl clone;
- clone = __clone
+ .long PLTJMP( HIDDEN_JUMPTARGET(_exit))
+.size clone,.-clone;
#include "syscall_error.S"
diff --git a/libc/sysdeps/linux/sh/longjmp.c b/libc/sysdeps/linux/sh/longjmp.c
index ee3afcd74..7c729564a 100644
--- a/libc/sysdeps/linux/sh/longjmp.c
+++ b/libc/sysdeps/linux/sh/longjmp.c
@@ -25,6 +25,7 @@
#include <signal.h>
extern int __longjmp(char *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
diff --git a/libc/sysdeps/linux/sh/mmap.c b/libc/sysdeps/linux/sh/mmap.c
index 5424942b6..cefc532a2 100644
--- a/libc/sysdeps/linux/sh/mmap.c
+++ b/libc/sysdeps/linux/sh/mmap.c
@@ -31,6 +31,6 @@
#include <sys/syscall.h>
-#define __NR___mmap __NR_mmap
-attribute_hidden _syscall6(__ptr_t, __mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset);
-strong_alias(__mmap,mmap)
+_syscall6(__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset);
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/sh/pipe.c b/libc/sysdeps/linux/sh/pipe.c
index a15034599..bfa54b7c9 100644
--- a/libc/sysdeps/linux/sh/pipe.c
+++ b/libc/sysdeps/linux/sh/pipe.c
@@ -5,7 +5,7 @@
#include <unistd.h>
#include <syscall.h>
-int attribute_hidden __pipe(int *fd)
+int pipe(int *fd)
{
long __res, __res2;
__asm__ __volatile__ (
@@ -27,4 +27,3 @@ int attribute_hidden __pipe(int *fd)
fd[1] = __res2;
return(0);
}
-strong_alias(__pipe,pipe)
diff --git a/libc/sysdeps/linux/sh/pread_write.c b/libc/sysdeps/linux/sh/pread_write.c
index 55b234855..23454e035 100644
--- a/libc/sysdeps/linux/sh/pread_write.c
+++ b/libc/sysdeps/linux/sh/pread_write.c
@@ -58,7 +58,7 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset)
{
return(__syscall_pread(fd,buf,count,0,__LONG_LONG_PAIR((off_t)0,offset)));
}
-weak_alias (__libc_pread, pread)
+strong_alias(__libc_pread,pread)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
@@ -67,7 +67,7 @@ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset)
uint32_t high = offset >> 32;
return(__syscall_pread(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
}
-weak_alias (__libc_pread64, pread64)
+strong_alias(__libc_pread64,pread64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* __NR_pread */
@@ -91,7 +91,7 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset)
{
return(__syscall_pwrite(fd,buf,count,0,__LONG_LONG_PAIR((off_t)0,offset)));
}
-weak_alias (__libc_pwrite, pwrite)
+strong_alias(__libc_pwrite,pwrite)
#if defined __UCLIBC_HAS_LFS__
ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
@@ -100,7 +100,7 @@ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset)
uint32_t high = offset >> 32;
return(__syscall_pwrite(fd, buf, count, 0, __LONG_LONG_PAIR (high, low)));
}
-weak_alias (__libc_pwrite64, pwrite64)
+strong_alias(__libc_pwrite64,pwrite64)
#endif /* __UCLIBC_HAS_LFS__ */
#endif /* __NR_pwrite */
diff --git a/libc/sysdeps/linux/sh/sbrk.c b/libc/sysdeps/linux/sh/sbrk.c
index e9faf7db0..7ccefdf58 100644
--- a/libc/sysdeps/linux/sh/sbrk.c
+++ b/libc/sysdeps/linux/sh/sbrk.c
@@ -9,8 +9,8 @@ extern void * __curbrk;
extern int __init_brk (void);
extern void *_brk(void *ptr) attribute_hidden;
-void attribute_hidden *
-__sbrk(intptr_t increment)
+void *
+sbrk(intptr_t increment)
{
if (__init_brk () == 0)
{
@@ -23,4 +23,5 @@ __sbrk(intptr_t increment)
}
return ((void *) -1);
}
-strong_alias(__sbrk,sbrk)
+libc_hidden_proto(sbrk)
+libc_hidden_def(sbrk)
diff --git a/libc/sysdeps/linux/sh/vfork.S b/libc/sysdeps/linux/sh/vfork.S
index f3c20a9d6..5c6a356e6 100644
--- a/libc/sysdeps/linux/sh/vfork.S
+++ b/libc/sysdeps/linux/sh/vfork.S
@@ -32,12 +32,11 @@
and the process ID of the new process to the old process. */
.text
-.globl __vfork
-.hidden __vfork
-.type __vfork,@function
+.globl vfork
+.type vfork,@function
.align 4
-__vfork:
+vfork:
mov.w .L2, r3
trapa #0x10
mov r0, r1
@@ -107,8 +106,7 @@ __vfork:
.L3:
.word __NR_fork
-.size __vfork, .-__vfork
-strong_alias(__vfork,vfork)
+.size vfork, .-vfork
+libc_hidden_def(vfork)
#include "syscall_error.S"
-
diff --git a/libc/sysdeps/linux/sh64/brk.c b/libc/sysdeps/linux/sh64/brk.c
index d6063fc27..443c03b25 100644
--- a/libc/sysdeps/linux/sh64/brk.c
+++ b/libc/sysdeps/linux/sh64/brk.c
@@ -9,7 +9,7 @@ extern void * __curbrk;
extern int __init_brk (void);
extern void *_brk(void *ptr) attribute_hidden;
-int attribute_hidden __brk(void * end_data_seg)
+int brk(void * end_data_seg)
{
if (__init_brk () == 0)
{
@@ -20,4 +20,5 @@ int attribute_hidden __brk(void * end_data_seg)
}
return -1;
}
-strong_alias(__brk,brk)
+libc_hidden_proto(brk)
+libc_hidden_def(brk)
diff --git a/libc/sysdeps/linux/sparc/__longjmp.S b/libc/sysdeps/linux/sparc/__longjmp.S
index 06828e61e..fa60264ef 100644
--- a/libc/sysdeps/linux/sparc/__longjmp.S
+++ b/libc/sysdeps/linux/sparc/__longjmp.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>
#define _ASM 1
@@ -83,3 +84,5 @@ __longjmp:
mov %g2, %o0 /* Delay slot: set return value. */
.size __longjmp,.-__longjmp
+
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/sparc/brk.c b/libc/sysdeps/linux/sparc/brk.c
index 9e178e34f..21464f740 100644
--- a/libc/sysdeps/linux/sparc/brk.c
+++ b/libc/sysdeps/linux/sparc/brk.c
@@ -26,7 +26,7 @@
void *__curbrk = 0;
-int attribute_hidden __brk (void *addr)
+int brk (void *addr)
{
void *newbrk;
@@ -47,4 +47,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/sparc/clone.S b/libc/sysdeps/linux/sparc/clone.S
index e9e6b17dd..0e41ee0cb 100644
--- a/libc/sysdeps/linux/sparc/clone.S
+++ b/libc/sysdeps/linux/sparc/clone.S
@@ -20,16 +20,17 @@
/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
+#include <features.h>
#include <asm/unistd.h>
/* 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:
save %sp,-96,%sp
/* sanity check arguments */
@@ -52,17 +53,14 @@ __clone:
__error:
jmp __syscall_error
-.size __clone,.-__clone
+.size clone,.-clone
.type __thread_start,%function
__thread_start:
call %i0
mov %i3,%o0
- call _exit_internal,0
+ call HIDDEN_JUMPTARGET(_exit),0
nop
.size __thread_start,.-__thread_start
-
-.weak clone
- clone = __clone
diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S
index dfa109dcd..f726e5aef 100644
--- a/libc/sysdeps/linux/sparc/fork.S
+++ b/libc/sysdeps/linux/sparc/fork.S
@@ -23,12 +23,11 @@
#include <sys/syscall.h>
.text
-.global __fork
-.hidden __fork
-.type __fork,%function
+.global fork
+.type fork,%function
.align 4
-__fork:
+fork:
mov __NR_fork, %g1
ta 0x10
bcc,a 9000f
@@ -45,6 +44,6 @@ __fork:
retl
and %o0, %o1, %o0
-.size __fork,.-__fork
-strong_alias(__fork,fork)
-weak_alias(fork,__libc_fork)
+.size fork,.-fork
+libc_hidden_def(fork)
+strong_alias(fork,__libc_fork)
diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S
index ad6b97e96..b509f65a4 100644
--- a/libc/sysdeps/linux/sparc/vfork.S
+++ b/libc/sysdeps/linux/sparc/vfork.S
@@ -25,18 +25,17 @@
#ifndef __NR_vfork
/* No vfork so use fork instead */
-hidden_strong_alias(__fork,__vfork)
-weak_alias(vfork,__libc_fork)
+strong_alias(fork,vfork)
+strong_alias(vfork,__libc_fork)
#else
.text
-.global __vfork
-.hidden __vfork
-.type __vfork,%function
+.global vfork
+.type vfork,%function
.align 4
-__vfork:
+vfork:
mov __NR_vfork, %g1
ta 0x10
bcc,a 9000f
@@ -53,6 +52,6 @@ __vfork:
retl
and %o0, %o1, %o0
-.size __vfork,.-__vfork
+.size vfork,.-vfork
#endif /* __NR_vfork */
-strong_alias(__vfork,vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/v850/__longjmp.S b/libc/sysdeps/linux/v850/__longjmp.S
index f91086189..98d99bc1e 100644
--- a/libc/sysdeps/linux/v850/__longjmp.S
+++ b/libc/sysdeps/linux/v850/__longjmp.S
@@ -11,6 +11,7 @@
* Written by Miles Bader <miles@gnu.org>
*/
+#include <features.h>
#define _SETJMP_H
#define _ASM
#include <bits/setjmp.h>
@@ -40,3 +41,4 @@ C_END(__longjmp)
.weak C_SYMBOL_NAME(__sigprocmask)
C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/v850/mmap.c b/libc/sysdeps/linux/v850/mmap.c
index a9cb0bcab..f075ac77c 100644
--- a/libc/sysdeps/linux/v850/mmap.c
+++ b/libc/sysdeps/linux/v850/mmap.c
@@ -7,3 +7,5 @@
_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
int, flags, int, fd, __off_t, offset);
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/v850/vfork.S b/libc/sysdeps/linux/v850/vfork.S
index e5058a49a..ace1bd16b 100644
--- a/libc/sysdeps/linux/v850/vfork.S
+++ b/libc/sysdeps/linux/v850/vfork.S
@@ -11,6 +11,7 @@
* Written by Miles Bader <miles@gnu.org>
*/
+#include <features.h>
#define _ERRNO_H 1
#include <bits/errno.h>
#define _SYSCALL_H
@@ -25,7 +26,7 @@
.global C_SYMBOL_NAME(errno)
-C_ENTRY (__vfork):
+C_ENTRY (vfork):
addi SYS_vfork, r0, r12
trap 0
addi -125, r0, r11 // minimum err value
@@ -36,7 +37,6 @@ C_ENTRY (__vfork):
subr r0, r10
st.w r10, 0[r11]
jmp [lp] // error return
-C_END(__vfork)
+C_END(vfork)
-.weak C_SYMBOL_NAME(vfork)
-C_SYMBOL_NAME(vfork) = C_SYMBOL_NAME(__vfork)
+libc_hidden_def(vfork)
diff --git a/libc/sysdeps/linux/x86_64/__longjmp.S b/libc/sysdeps/linux/x86_64/__longjmp.S
index aa47b7233..1ff6e0169 100644
--- a/libc/sysdeps/linux/x86_64/__longjmp.S
+++ b/libc/sysdeps/linux/x86_64/__longjmp.S
@@ -16,6 +16,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+#include <features.h>
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
@@ -43,3 +44,4 @@ __longjmp:
movq (JB_RSP*8)(%rdi),%rsp
jmpq *%rdx
.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
diff --git a/libc/sysdeps/linux/x86_64/brk.c b/libc/sysdeps/linux/x86_64/brk.c
index a00e2361e..8d85bcb3d 100644
--- a/libc/sysdeps/linux/x86_64/brk.c
+++ b/libc/sysdeps/linux/x86_64/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 *__unbounded newbrk;
@@ -42,4 +42,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/x86_64/clone.S b/libc/sysdeps/linux/x86_64/clone.S
index 0ae999722..bea2e3a7a 100644
--- a/libc/sysdeps/linux/x86_64/clone.S
+++ b/libc/sysdeps/linux/x86_64/clone.S
@@ -50,10 +50,10 @@
.text
-.global __clone
-.type __clone,%function
+.global clone
+.type clone,%function
.align 4
-__clone:
+clone:
/* Sanity check arguments. */
movq $-EINVAL,%rax
testq %rdi,%rdi /* no NULL function pointers */
@@ -109,9 +109,6 @@ __clone:
call *%rax
/* Call exit with return value from function call. */
movq %rax, %rdi
- call _exit_internal
+ call HIDDEN_JUMPTARGET(_exit)
-.size __clone,.-__clone
-
-.weak clone
- clone = __clone
+.size clone,.-clone
diff --git a/libc/sysdeps/linux/x86_64/mmap.c b/libc/sysdeps/linux/x86_64/mmap.c
index f14f1b6f9..b69f0a2f2 100644
--- a/libc/sysdeps/linux/x86_64/mmap.c
+++ b/libc/sysdeps/linux/x86_64/mmap.c
@@ -13,7 +13,7 @@
#include <sys/mman.h>
#include <sys/syscall.h>
-#define __NR___mmap __NR_mmap
-attribute_hidden _syscall6(void *, __mmap, void *, start, size_t, length, int, prot,
+_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
int, flags, int, fd, off_t, offset);
-strong_alias(__mmap,mmap)
+libc_hidden_proto(mmap)
+libc_hidden_def(mmap)
diff --git a/libc/sysdeps/linux/x86_64/sigaction.c b/libc/sysdeps/linux/x86_64/sigaction.c
index 250c8b5c6..7a2d1ce28 100644
--- a/libc/sysdeps/linux/x86_64/sigaction.c
+++ b/libc/sysdeps/linux/x86_64/sigaction.c
@@ -23,11 +23,8 @@
#include <signal.h>
#include <string.h>
-
#include <sys/syscall.h>
-
-
/* The difference here is that the sigaction structure used in the
kernel is not the same as we use in the libc. Therefore we must
translate it here. */
@@ -42,6 +39,8 @@
extern void restore_rt (void) asm ("__restore_rt") attribute_hidden;
extern void restore (void) asm ("__restore") attribute_hidden;
+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. */
/* psm: couldn't use __sigaction, if building w/ disabled hidden,
@@ -54,7 +53,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
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 | SA_RESTORER;
kact.sa_restorer = &restore_rt;
@@ -67,7 +66,7 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
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;
oact->sa_restorer = koact.sa_restorer;
}
@@ -121,8 +120,9 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
#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
/* NOTE: Please think twice before making any changes to the bits of
diff --git a/libc/sysdeps/linux/x86_64/vfork.S b/libc/sysdeps/linux/x86_64/vfork.S
index 996f1289e..3315e337a 100644
--- a/libc/sysdeps/linux/x86_64/vfork.S
+++ b/libc/sysdeps/linux/x86_64/vfork.S
@@ -26,18 +26,17 @@
#ifndef __NR_vfork
/* No vfork so use fork instead */
-hidden_strong_alias(__fork,__vfork)
-weak_alias(vfork,__libc_fork)
+strong_alias(fork,vfork)
+strong_alias(vfork,__libc_fork)
#else
.text
-.global __vfork
-.hidden __vfork
-.type __vfork,%function
+.global vfork
+.type vfork,%function
.align 16
-__vfork:
+vfork:
/* Pop the return PC value into RDI. We need a register that
is preserved by the syscall and that we're allowed to destroy. */
@@ -56,7 +55,7 @@ __vfork:
/* Normal return. */
ret
-.size __vfork,.-__vfork
+.size vfork,.-vfork
#endif /* __NR_vfork */
-strong_alias(__vfork,vfork)
+libc_hidden_def(vfork)