summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-12-08 21:01:23 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-12-08 21:01:23 +0000
commit77ccb5b1dca86acdc7c75abc5bb469da41872a20 (patch)
tree13fb13805ef3018a0a12f102f72ce2c61532fde3
parent7a3dea048d88faa3bbe1c99bcf3fdb98eabae52d (diff)
mmap/mremap/socket/rewind gone
-rw-r--r--include/libc-internal.h3
-rw-r--r--libc/inet/getaddrinfo.c2
-rw-r--r--libc/inet/getnetent.c1
-rw-r--r--libc/inet/getproto.c1
-rw-r--r--libc/inet/getservice.c1
-rw-r--r--libc/inet/if_nametoindex.c4
-rw-r--r--libc/inet/resolv.c6
-rw-r--r--libc/inet/rpc/clnt_tcp.c2
-rw-r--r--libc/inet/rpc/clnt_udp.c5
-rw-r--r--libc/inet/rpc/clnt_unix.c4
-rw-r--r--libc/inet/rpc/get_myaddress.c2
-rw-r--r--libc/inet/rpc/getrpcent.c1
-rw-r--r--libc/inet/rpc/pmap_clnt.c2
-rw-r--r--libc/inet/rpc/pmap_rmt.c4
-rw-r--r--libc/inet/rpc/rcmd.c2
-rw-r--r--libc/inet/rpc/rexec.c4
-rw-r--r--libc/inet/rpc/rtime.c4
-rw-r--r--libc/inet/rpc/svc_tcp.c2
-rw-r--r--libc/inet/rpc/svc_udp.c6
-rw-r--r--libc/inet/rpc/svc_unix.c4
-rw-r--r--libc/misc/syslog/syslog.c2
-rw-r--r--libc/misc/ttyent/getttyent.c1
-rw-r--r--libc/pwd_grp/pwd_grp.c1
-rw-r--r--libc/stdio/rewind.c3
-rw-r--r--libc/stdlib/malloc-simple/alloc.c1
-rw-r--r--libc/stdlib/malloc-standard/malloc.h1
-rw-r--r--libc/stdlib/malloc-standard/realloc.c2
-rw-r--r--libc/stdlib/malloc/malloc.c2
-rw-r--r--libc/sysdeps/linux/arm/ioperm.c1
-rw-r--r--libc/sysdeps/linux/arm/mmap64.S5
-rw-r--r--libc/sysdeps/linux/common/mmap.c3
-rw-r--r--libc/sysdeps/linux/common/mmap64.c3
-rw-r--r--libc/sysdeps/linux/common/mremap.c4
-rw-r--r--libc/sysdeps/linux/frv/mmap.c3
-rw-r--r--libc/sysdeps/linux/hppa/mmap.c4
-rw-r--r--libc/sysdeps/linux/i386/mmap.S11
-rw-r--r--libc/sysdeps/linux/mips/mmap.c4
-rw-r--r--libc/sysdeps/linux/powerpc/mmap.c4
-rw-r--r--libc/sysdeps/linux/sh/mmap.c4
-rw-r--r--libc/sysdeps/linux/x86_64/mmap.c4
-rw-r--r--libc/unistd/exec.c1
41 files changed, 86 insertions, 38 deletions
diff --git a/include/libc-internal.h b/include/libc-internal.h
index 9c9ab4b7f..5faa87871 100644
--- a/include/libc-internal.h
+++ b/include/libc-internal.h
@@ -198,6 +198,9 @@ extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set,
/* #include <sys/ioctl.h> */
extern int __ioctl (int __fd, unsigned long int __request, ...) attribute_hidden;
+/* #include <sys/socket.h> */
+extern int __socket (int __domain, int __type, int __protocol) attribute_hidden;
+
# if 0 /* undoable here */
/* #include <dirent.h> */
typedef struct __dirstream DIR;
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index 2dd14d78f..a85e2ff5e 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -159,7 +159,7 @@ static int addrconfig (sa_family_t af)
int s;
int ret;
int saved_errno = errno;
- s = socket(af, SOCK_DGRAM, 0);
+ s = __socket(af, SOCK_DGRAM, 0);
if (s < 0)
ret = (errno == EMFILE) ? 1 : 0;
else
diff --git a/libc/inet/getnetent.c b/libc/inet/getnetent.c
index f2c2cd97d..edbae55b0 100644
--- a/libc/inet/getnetent.c
+++ b/libc/inet/getnetent.c
@@ -16,6 +16,7 @@
*/
#define inet_network __inet_network
+#define rewind __rewind
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c
index ec00b5e93..0c0e2c468 100644
--- a/libc/inet/getproto.c
+++ b/libc/inet/getproto.c
@@ -53,6 +53,7 @@
#define strpbrk __strpbrk
#define atoi __atoi
+#define rewind __rewind
#define __FORCE_GLIBC
#define _GNU_SOURCE
diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c
index 6026273b4..79cdf7434 100644
--- a/libc/inet/getservice.c
+++ b/libc/inet/getservice.c
@@ -53,6 +53,7 @@
#define strpbrk __strpbrk
#define atoi __atoi
+#define rewind __rewind
#define __FORCE_GLIBC
#define _GNU_SOURCE
diff --git a/libc/inet/if_nametoindex.c b/libc/inet/if_nametoindex.c
index 909cf503a..f3803e56b 100644
--- a/libc/inet/if_nametoindex.c
+++ b/libc/inet/if_nametoindex.c
@@ -32,10 +32,10 @@ static int __opensock(void)
{
int fd;
#ifdef __UCLIBC_HAS_IPV6__
- fd=socket(AF_INET6,SOCK_DGRAM,0);
+ fd=__socket(AF_INET6,SOCK_DGRAM,0);
if (fd<0)
#endif /* __UCLIBC_HAS_IPV6__ */
- fd=socket(AF_INET,SOCK_DGRAM,0);
+ fd=__socket(AF_INET,SOCK_DGRAM,0);
return(fd);
}
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 97ed3998f..d93adede8 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -146,6 +146,8 @@
#define inet_ntop __inet_ntop
#define connect __connect
#define select __select
+#define recv __recv
+#define send __send
#define __FORCE_GLIBC
#include <features.h>
@@ -770,9 +772,9 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
#ifdef __UCLIBC_HAS_IPV6__
v6 = inet_pton(AF_INET6, dns, &sa6.sin6_addr) > 0;
- fd = socket(v6 ? AF_INET6 : AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ fd = __socket(v6 ? AF_INET6 : AF_INET, SOCK_DGRAM, IPPROTO_UDP);
#else
- fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ fd = __socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
#endif
if (fd < 0) {
retries++;
diff --git a/libc/inet/rpc/clnt_tcp.c b/libc/inet/rpc/clnt_tcp.c
index 50300d591..67892cc4b 100644
--- a/libc/inet/rpc/clnt_tcp.c
+++ b/libc/inet/rpc/clnt_tcp.c
@@ -175,7 +175,7 @@ __clnttcp_create (struct sockaddr_in *raddr, u_long prog, u_long vers,
*/
if (*sockp < 0)
{
- *sockp = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ *sockp = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
(void) bindresvport (*sockp, (struct sockaddr_in *) 0);
if ((*sockp < 0)
|| (connect (*sockp, (struct sockaddr *) raddr,
diff --git a/libc/inet/rpc/clnt_udp.c b/libc/inet/rpc/clnt_udp.c
index 217650bf5..7855dcb2f 100644
--- a/libc/inet/rpc/clnt_udp.c
+++ b/libc/inet/rpc/clnt_udp.c
@@ -49,6 +49,9 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
#define _seterr_reply __seterr_reply
#define setsockopt __setsockopt
#define bindresvport __bindresvport
+#define recvfrom __recvfrom
+#define sendto __sendto
+#define recvmsg __recvmsg
#define __FORCE_GLIBC
#include <features.h>
@@ -197,7 +200,7 @@ __clntudp_bufcreate (struct sockaddr_in *raddr, u_long program, u_long version,
{
int dontblock = 1;
- *sockp = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ *sockp = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (*sockp < 0)
{
struct rpc_createerr *ce = &get_rpc_createerr ();
diff --git a/libc/inet/rpc/clnt_unix.c b/libc/inet/rpc/clnt_unix.c
index 23154bab3..56f23b749 100644
--- a/libc/inet/rpc/clnt_unix.c
+++ b/libc/inet/rpc/clnt_unix.c
@@ -59,6 +59,8 @@
#define _seterr_reply __seterr_reply
#define setsockopt __setsockopt
#define connect __connect
+#define recvmsg __recvmsg
+#define sendmsg __sendmsg
#define __FORCE_GLIBC
#include <features.h>
@@ -158,7 +160,7 @@ __clntunix_create (struct sockaddr_un *raddr, u_long prog, u_long vers,
*/
if (*sockp < 0)
{
- *sockp = socket (AF_UNIX, SOCK_STREAM, 0);
+ *sockp = __socket (AF_UNIX, SOCK_STREAM, 0);
len = __strlen (raddr->sun_path) + sizeof (raddr->sun_family) + 1;
if (*sockp < 0
|| connect (*sockp, (struct sockaddr *) raddr, len) < 0)
diff --git a/libc/inet/rpc/get_myaddress.c b/libc/inet/rpc/get_myaddress.c
index 51674656e..bdbafa44d 100644
--- a/libc/inet/rpc/get_myaddress.c
+++ b/libc/inet/rpc/get_myaddress.c
@@ -65,7 +65,7 @@ get_myaddress (struct sockaddr_in *addr)
struct ifreq ifreq, *ifr;
int len, loopback = 0;
- if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
{
__perror ("get_myaddress: socket");
exit (1);
diff --git a/libc/inet/rpc/getrpcent.c b/libc/inet/rpc/getrpcent.c
index 90e8b70d4..c2e101510 100644
--- a/libc/inet/rpc/getrpcent.c
+++ b/libc/inet/rpc/getrpcent.c
@@ -34,6 +34,7 @@
*/
#define atoi __atoi
+#define rewind __rewind
#define __FORCE_GLIBC
#include <features.h>
diff --git a/libc/inet/rpc/pmap_clnt.c b/libc/inet/rpc/pmap_clnt.c
index 0abe646a1..49cd93f4b 100644
--- a/libc/inet/rpc/pmap_clnt.c
+++ b/libc/inet/rpc/pmap_clnt.c
@@ -66,7 +66,7 @@ __get_myaddress (struct sockaddr_in *addr)
struct ifreq ifreq, *ifr;
int len, loopback = 1;
- if ((s = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
{
__perror ("__get_myaddress: socket");
exit (1);
diff --git a/libc/inet/rpc/pmap_rmt.c b/libc/inet/rpc/pmap_rmt.c
index 2a814795a..60821ec6c 100644
--- a/libc/inet/rpc/pmap_rmt.c
+++ b/libc/inet/rpc/pmap_rmt.c
@@ -49,6 +49,8 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
#define inet_netof __inet_netof
#define clntudp_create __clntudp_create
#define setsockopt __setsockopt
+#define recvfrom __recvfrom
+#define sendto __sendto
#define __FORCE_GLIBC
#include <features.h>
@@ -274,7 +276,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
* initialization: create a socket, a broadcast address, and
* preserialize the arguments into a send buffer.
*/
- if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
{
__perror (_("Cannot create socket for broadcast rpc"));
stat = RPC_CANTSEND;
diff --git a/libc/inet/rpc/rcmd.c b/libc/inet/rpc/rcmd.c
index 55f9e4042..726be44a1 100644
--- a/libc/inet/rpc/rcmd.c
+++ b/libc/inet/rpc/rcmd.c
@@ -280,7 +280,7 @@ int attribute_hidden __rresvport(int *alport)
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
- s = socket(AF_INET, SOCK_STREAM, 0);
+ s = __socket(AF_INET, SOCK_STREAM, 0);
if (s < 0)
return -1;
for (;;) {
diff --git a/libc/inet/rpc/rexec.c b/libc/inet/rpc/rexec.c
index 6312366eb..cac783cc3 100644
--- a/libc/inet/rpc/rexec.c
+++ b/libc/inet/rpc/rexec.c
@@ -93,7 +93,7 @@ __rexec_af(char **ahost, int rport, const char *name, const char *pass, const ch
}
__ruserpass(res0->ai_canonname, &name, &pass);
retry:
- s = socket(res0->ai_family, res0->ai_socktype, 0);
+ s = __socket(res0->ai_family, res0->ai_socktype, 0);
if (s < 0) {
__perror("rexec: socket");
return (-1);
@@ -115,7 +115,7 @@ retry:
char num[32];
int s2, sa2len;
- s2 = socket(res0->ai_family, res0->ai_socktype, 0);
+ s2 = __socket(res0->ai_family, res0->ai_socktype, 0);
if (s2 < 0) {
(void) __close(s);
return (-1);
diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c
index 2e20621f9..728dbab61 100644
--- a/libc/inet/rpc/rtime.c
+++ b/libc/inet/rpc/rtime.c
@@ -44,6 +44,8 @@ static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 S
*/
#define connect __connect
+#define recvfrom __recvfrom
+#define sendto __sendto
#define __FORCE_GLIBC
#include <features.h>
@@ -93,7 +95,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
else
type = SOCK_DGRAM;
- s = socket (AF_INET, type, 0);
+ s = __socket (AF_INET, type, 0);
if (s < 0)
return (-1);
diff --git a/libc/inet/rpc/svc_tcp.c b/libc/inet/rpc/svc_tcp.c
index b3cd83fa8..2638d55be 100644
--- a/libc/inet/rpc/svc_tcp.c
+++ b/libc/inet/rpc/svc_tcp.c
@@ -166,7 +166,7 @@ svctcp_create (int sock, u_int sendsize, u_int recvsize)
if (sock == RPC_ANYSOCK)
{
- if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ if ((sock = __socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
{
__perror (_("svc_tcp.c - tcp socket creation problem"));
return (SVCXPRT *) NULL;
diff --git a/libc/inet/rpc/svc_udp.c b/libc/inet/rpc/svc_udp.c
index 0f731a6ba..62719ee33 100644
--- a/libc/inet/rpc/svc_udp.c
+++ b/libc/inet/rpc/svc_udp.c
@@ -48,6 +48,10 @@ static char sccsid[] = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
#define setsockopt __setsockopt
#define bind __bind
#define bindresvport __bindresvport
+#define recvfrom __recvfrom
+#define sendto __sendto
+#define recvmsg __recvmsg
+#define sendmsg __sendmsg
#define __FORCE_GLIBC
#define _GNU_SOURCE
@@ -135,7 +139,7 @@ __svcudp_bufcreate (int sock, u_int sendsz, u_int recvsz)
if (sock == RPC_ANYSOCK)
{
- if ((sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
+ if ((sock = __socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
{
__perror (_("svcudp_create: socket creation problem"));
return (SVCXPRT *) NULL;
diff --git a/libc/inet/rpc/svc_unix.c b/libc/inet/rpc/svc_unix.c
index 8b1e8b2d5..ed40146eb 100644
--- a/libc/inet/rpc/svc_unix.c
+++ b/libc/inet/rpc/svc_unix.c
@@ -50,6 +50,8 @@
#define getsockname __getsockname
#define setsockopt __setsockopt
#define bind __bind
+#define recvmsg __recvmsg
+#define sendmsg __sendmsg
#define __FORCE_GLIBC
#include <features.h>
@@ -161,7 +163,7 @@ svcunix_create (int sock, u_int sendsize, u_int recvsize, char *path)
if (sock == RPC_ANYSOCK)
{
- if ((sock = socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
+ if ((sock = __socket (AF_UNIX, SOCK_STREAM, 0)) < 0)
{
__perror (_("svc_unix.c - AF_UNIX socket creation problem"));
return (SVCXPRT *) NULL;
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index 3d0e9fb7b..504154f90 100644
--- a/libc/misc/syslog/syslog.c
+++ b/libc/misc/syslog/syslog.c
@@ -148,7 +148,7 @@ __openlog( const char *ident, int logstat, int logfac )
sizeof(SyslogAddr.sa_data));
retry:
if (LogStat & LOG_NDELAY) {
- if ((LogFile = socket(AF_UNIX, logType, 0)) == -1){
+ if ((LogFile = __socket(AF_UNIX, logType, 0)) == -1){
UNLOCK;
return;
}
diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c
index 04f511921..8e104733c 100644
--- a/libc/misc/ttyent/getttyent.c
+++ b/libc/misc/ttyent/getttyent.c
@@ -28,6 +28,7 @@
*/
#define __fsetlocking __fsetlocking_internal
+#define rewind __rewind
#define _GNU_SOURCE
#include <features.h>
diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c
index 2cc032ea3..39b2a1ca0 100644
--- a/libc/pwd_grp/pwd_grp.c
+++ b/libc/pwd_grp/pwd_grp.c
@@ -20,6 +20,7 @@
#define setgroups __setgroups
#define strtoul __strtoul
+#define rewind __rewind
#define _GNU_SOURCE
#include <features.h>
diff --git a/libc/stdio/rewind.c b/libc/stdio/rewind.c
index 7f36a77ff..aa4534aa7 100644
--- a/libc/stdio/rewind.c
+++ b/libc/stdio/rewind.c
@@ -7,7 +7,7 @@
#include "_stdio.h"
-void rewind(register FILE *stream)
+void attribute_hidden __rewind(register FILE *stream)
{
__STDIO_AUTO_THREADLOCK_VAR;
@@ -18,3 +18,4 @@ void rewind(register FILE *stream)
__STDIO_AUTO_THREADUNLOCK(stream);
}
+strong_alias(__rewind,rewind)
diff --git a/libc/stdlib/malloc-simple/alloc.c b/libc/stdlib/malloc-simple/alloc.c
index d20768738..5a208bf28 100644
--- a/libc/stdlib/malloc-simple/alloc.c
+++ b/libc/stdlib/malloc-simple/alloc.c
@@ -6,6 +6,7 @@
* Parts of the memalign code were stolen from malloc-930716.
*/
+#define mmap __mmap
#define munmap __munmap
#define _GNU_SOURCE
diff --git a/libc/stdlib/malloc-standard/malloc.h b/libc/stdlib/malloc-standard/malloc.h
index 0e8aed363..338edeabf 100644
--- a/libc/stdlib/malloc-standard/malloc.h
+++ b/libc/stdlib/malloc-standard/malloc.h
@@ -14,6 +14,7 @@
Hacked up for uClibc by Erik Andersen <andersen@codepoet.org>
*/
+#define mmap __mmap
#define sysconf __sysconf
#include <features.h>
diff --git a/libc/stdlib/malloc-standard/realloc.c b/libc/stdlib/malloc-standard/realloc.c
index 3d77442af..36bfe4d99 100644
--- a/libc/stdlib/malloc-standard/realloc.c
+++ b/libc/stdlib/malloc-standard/realloc.c
@@ -14,6 +14,8 @@
Hacked up for uClibc by Erik Andersen <andersen@codepoet.org>
*/
+#define mremap __mremap
+
#include "malloc.h"
diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c
index e4523adb2..44eb2c66f 100644
--- a/libc/stdlib/malloc/malloc.c
+++ b/libc/stdlib/malloc/malloc.c
@@ -11,6 +11,8 @@
* Written by Miles Bader <miles@gnu.org>
*/
+#define mmap __mmap
+
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c
index d69d475d6..15162f916 100644
--- a/libc/sysdeps/linux/arm/ioperm.c
+++ b/libc/sysdeps/linux/arm/ioperm.c
@@ -34,6 +34,7 @@
enable all the ports all of the time. */
#define readlink __readlink
+#define mmap __mmap
#include <errno.h>
#include <fcntl.h>
diff --git a/libc/sysdeps/linux/arm/mmap64.S b/libc/sysdeps/linux/arm/mmap64.S
index 63b02f9df..8fb7edcce 100644
--- a/libc/sysdeps/linux/arm/mmap64.S
+++ b/libc/sysdeps/linux/arm/mmap64.S
@@ -52,10 +52,7 @@ mmap64:
mov r0, ip @ first arg was clobbered
teq r5, $0
ldmeqfd sp!, {r4, r5, lr}
-#ifdef __PIC__
- beq mmap(PLT)
-#else
- beq mmap
+ beq __mmap
#endif
.Linval:
mov r0, $-EINVAL
diff --git a/libc/sysdeps/linux/common/mmap.c b/libc/sysdeps/linux/common/mmap.c
index 94c0d82b3..7387f28b4 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);
-__ptr_t mmap(__ptr_t addr, size_t len, int prot,
+__ptr_t attribute_hidden __mmap(__ptr_t addr, size_t len, int prot,
int flags, int fd, __off_t offset)
{
unsigned long buffer[6];
@@ -27,4 +27,5 @@ __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)
#endif
diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c
index 7f329c6c9..804d6af50 100644
--- a/libc/sysdeps/linux/common/mmap64.c
+++ b/libc/sysdeps/linux/common/mmap64.c
@@ -19,6 +19,8 @@
/* Massivly hacked up for uClibc by Erik Andersen */
+#define mmap __mmap
+
#include <features.h>
#include <errno.h>
#include <unistd.h>
@@ -84,4 +86,3 @@ __ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t
#endif
#endif /* __UCLIBC_HAS_LFS__ */
-
diff --git a/libc/sysdeps/linux/common/mremap.c b/libc/sysdeps/linux/common/mremap.c
index 200c2e1ef..f4a4670d2 100644
--- a/libc/sysdeps/linux/common/mremap.c
+++ b/libc/sysdeps/linux/common/mremap.c
@@ -10,5 +10,7 @@
#include "syscalls.h"
#include <unistd.h>
#include <sys/mman.h>
-_syscall4(__ptr_t, mremap, __ptr_t, old_address, size_t, old_size, size_t,
+#define __NR___mremap __NR_mremap
+attribute_hidden _syscall4(__ptr_t, __mremap, __ptr_t, old_address, size_t, old_size, size_t,
new_size, int, may_move);
+strong_alias(__mremap,mremap)
diff --git a/libc/sysdeps/linux/frv/mmap.c b/libc/sysdeps/linux/frv/mmap.c
index b3fd7c3d8..fa801bb5f 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 mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset)
+__ptr_t attribute_hidden __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,3 +46,4 @@ __ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offs
}
return(__syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT)));
}
+strong_alias(__mmap,mmap)
diff --git a/libc/sysdeps/linux/hppa/mmap.c b/libc/sysdeps/linux/hppa/mmap.c
index 117d93ddc..f14f1b6f9 100644
--- a/libc/sysdeps/linux/hppa/mmap.c
+++ b/libc/sysdeps/linux/hppa/mmap.c
@@ -13,5 +13,7 @@
#include <sys/mman.h>
#include <sys/syscall.h>
-_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
+#define __NR___mmap __NR_mmap
+attribute_hidden _syscall6(void *, __mmap, void *, start, size_t, length, int, prot,
int, flags, int, fd, off_t, offset);
+strong_alias(__mmap,mmap)
diff --git a/libc/sysdeps/linux/i386/mmap.S b/libc/sysdeps/linux/i386/mmap.S
index 5dde939bf..4c4723dff 100644
--- a/libc/sysdeps/linux/i386/mmap.S
+++ b/libc/sysdeps/linux/i386/mmap.S
@@ -21,10 +21,13 @@
#include <bits/errno.h>
#include <sys/syscall.h>
-.text
.global mmap
-.type mmap,%function
-mmap:
+.set mmap,__mmap
+.text
+.global __mmap
+.hidden __mmap
+.type __mmap,%function
+__mmap:
/* Save registers. */
movl %ebx, %edx
@@ -46,4 +49,4 @@ mmap:
/* Successful; return the syscall's value. */
ret
-.size mmap,.-mmap
+.size __mmap,.-__mmap
diff --git a/libc/sysdeps/linux/mips/mmap.c b/libc/sysdeps/linux/mips/mmap.c
index c6af2efd2..25a3ef5bd 100644
--- a/libc/sysdeps/linux/mips/mmap.c
+++ b/libc/sysdeps/linux/mips/mmap.c
@@ -14,5 +14,7 @@
#endif
#endif
-_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
+#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)
diff --git a/libc/sysdeps/linux/powerpc/mmap.c b/libc/sysdeps/linux/powerpc/mmap.c
index ec4bfd1f9..cac08ba65 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 * mmap(void *start, size_t length, int prot, int flags, int fd,
+void attribute_hidden * __mmap(void *start, size_t length, int prot, int flags, int fd,
off_t offset)
{
unsigned long __sc_ret, __sc_err;
@@ -45,4 +45,4 @@ void * mmap(void *start, size_t length, int prot, int flags, int fd,
__syscall_return (void *);
}
-
+strong_alias(__mmap,mmap)
diff --git a/libc/sysdeps/linux/sh/mmap.c b/libc/sysdeps/linux/sh/mmap.c
index 622857764..5424942b6 100644
--- a/libc/sysdeps/linux/sh/mmap.c
+++ b/libc/sysdeps/linux/sh/mmap.c
@@ -31,4 +31,6 @@
#include <sys/syscall.h>
-_syscall6(__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, __off_t, offset);
+#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)
diff --git a/libc/sysdeps/linux/x86_64/mmap.c b/libc/sysdeps/linux/x86_64/mmap.c
index 117d93ddc..f14f1b6f9 100644
--- a/libc/sysdeps/linux/x86_64/mmap.c
+++ b/libc/sysdeps/linux/x86_64/mmap.c
@@ -13,5 +13,7 @@
#include <sys/mman.h>
#include <sys/syscall.h>
-_syscall6(void *, mmap, void *, start, size_t, length, int, prot,
+#define __NR___mmap __NR_mmap
+attribute_hidden _syscall6(void *, __mmap, void *, start, size_t, length, int, prot,
int, flags, int, fd, off_t, offset);
+strong_alias(__mmap,mmap)
diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c
index 052728d83..e61ff1988 100644
--- a/libc/unistd/exec.c
+++ b/libc/unistd/exec.c
@@ -30,6 +30,7 @@
* to free the storage allocated for the copy. Better ideas anyone?
*/
+#define mmap __mmap
#define munmap __munmap
#define execve __execve