summaryrefslogtreecommitdiffstats
path: root/lib/libc/string
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-08-31 02:53:56 +0000
committerguenther <guenther@openbsd.org>2015-08-31 02:53:56 +0000
commit9b9d2a55a62c8e82206c25f94fcc7f4e2765250e (patch)
tree4e1fa28e81f1f4b2467c7facbde18ea61addb735 /lib/libc/string
parentspaces snuck in (diff)
downloadwireguard-openbsd-9b9d2a55a62c8e82206c25f94fcc7f4e2765250e.tar.xz
wireguard-openbsd-9b9d2a55a62c8e82206c25f94fcc7f4e2765250e.zip
Add framework for resolving (pun intended) libc namespace issues, using
wrapper .h files and asm labels to let internal calls resolve directly and not be overridable or use the PLT. Then, apply that framework to most of the functions in stdio.h, string.h, err.h, and wchar.h. Delete the should-have-been-hidden-all-along _v?(err|warn)[cx]? symbols while here. tests clean on i386, amd64, sparc64, powerpc, and mips64 naming feedback from kettenis@ and millert@ ok kettenis@
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/bcmp.c3
-rw-r--r--lib/libc/string/bcopy.c3
-rw-r--r--lib/libc/string/bzero.c3
-rw-r--r--lib/libc/string/explicit_bzero.c3
-rw-r--r--lib/libc/string/ffs.c3
-rw-r--r--lib/libc/string/memccpy.c3
-rw-r--r--lib/libc/string/memchr.c3
-rw-r--r--lib/libc/string/memcmp.c3
-rw-r--r--lib/libc/string/memcpy.c3
-rw-r--r--lib/libc/string/memmem.c3
-rw-r--r--lib/libc/string/memmove.c3
-rw-r--r--lib/libc/string/memrchr.c3
-rw-r--r--lib/libc/string/memset.c3
-rw-r--r--lib/libc/string/stpncpy.c3
-rw-r--r--lib/libc/string/strcasecmp.c4
-rw-r--r--lib/libc/string/strcasestr.c3
-rw-r--r--lib/libc/string/strchr.c3
-rw-r--r--lib/libc/string/strcmp.c3
-rw-r--r--lib/libc/string/strcoll.c3
-rw-r--r--lib/libc/string/strcspn.c3
-rw-r--r--lib/libc/string/strdup.c3
-rw-r--r--lib/libc/string/strerror.c3
-rw-r--r--lib/libc/string/strerror_r.c3
-rw-r--r--lib/libc/string/strlcat.c3
-rw-r--r--lib/libc/string/strlcpy.c3
-rw-r--r--lib/libc/string/strlen.c3
-rw-r--r--lib/libc/string/strmode.c3
-rw-r--r--lib/libc/string/strncat.c3
-rw-r--r--lib/libc/string/strncmp.c3
-rw-r--r--lib/libc/string/strncpy.c3
-rw-r--r--lib/libc/string/strndup.c3
-rw-r--r--lib/libc/string/strnlen.c3
-rw-r--r--lib/libc/string/strpbrk.c3
-rw-r--r--lib/libc/string/strrchr.c3
-rw-r--r--lib/libc/string/strsep.c3
-rw-r--r--lib/libc/string/strsignal.c1
-rw-r--r--lib/libc/string/strspn.c3
-rw-r--r--lib/libc/string/strstr.c3
-rw-r--r--lib/libc/string/strtok.c2
-rw-r--r--lib/libc/string/strxfrm.c3
-rw-r--r--lib/libc/string/timingsafe_bcmp.c3
-rw-r--r--lib/libc/string/timingsafe_memcmp.c3
42 files changed, 84 insertions, 40 deletions
diff --git a/lib/libc/string/bcmp.c b/lib/libc/string/bcmp.c
index f64672990c6..5d446bf0966 100644
--- a/lib/libc/string/bcmp.c
+++ b/lib/libc/string/bcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcmp.c,v 1.10 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: bcmp.c,v 1.11 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
@@ -49,3 +49,4 @@ bcmp(const void *b1, const void *b2, size_t length)
while (--length);
return (0);
}
+DEF_WEAK(bcmp);
diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c
index fcaa843c71c..ef0d3680538 100644
--- a/lib/libc/string/bcopy.c
+++ b/lib/libc/string/bcopy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcopy.c,v 1.6 2014/11/30 19:43:56 deraadt Exp $ */
+/* $OpenBSD: bcopy.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -110,3 +110,4 @@ bcopy(const void *src0, void *dst0, size_t length)
done:
return;
}
+DEF_WEAK(bcopy);
diff --git a/lib/libc/string/bzero.c b/lib/libc/string/bzero.c
index fdd3d9cc8da..5173de26dd1 100644
--- a/lib/libc/string/bzero.c
+++ b/lib/libc/string/bzero.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bzero.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: bzero.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1987 Regents of the University of California.
@@ -42,3 +42,4 @@ bzero(void *b, size_t length)
for (p = b; length--;)
*p++ = '\0';
}
+DEF_WEAK(bzero);
diff --git a/lib/libc/string/explicit_bzero.c b/lib/libc/string/explicit_bzero.c
index 3e33ca85b83..003ea7cc4c6 100644
--- a/lib/libc/string/explicit_bzero.c
+++ b/lib/libc/string/explicit_bzero.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: explicit_bzero.c,v 1.3 2014/06/21 02:34:26 matthew Exp $ */
+/* $OpenBSD: explicit_bzero.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
/*
* Public domain.
* Written by Matthew Dempsky.
@@ -17,3 +17,4 @@ explicit_bzero(void *buf, size_t len)
memset(buf, 0, len);
__explicit_bzero_hook(buf, len);
}
+DEF_WEAK(explicit_bzero);
diff --git a/lib/libc/string/ffs.c b/lib/libc/string/ffs.c
index de4480a7efd..a75fd9d79f8 100644
--- a/lib/libc/string/ffs.c
+++ b/lib/libc/string/ffs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: ffs.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*
* Public domain.
@@ -38,3 +38,4 @@ ffs(int mask)
return (bit + t[ r & 0xf ]);
}
+DEF_WEAK(ffs);
diff --git a/lib/libc/string/memccpy.c b/lib/libc/string/memccpy.c
index 485c55fcabf..635061b8cb9 100644
--- a/lib/libc/string/memccpy.c
+++ b/lib/libc/string/memccpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memccpy.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: memccpy.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,3 +46,4 @@ memccpy(void *t, const void *f, int c, size_t n)
}
return (0);
}
+DEF_WEAK(memccpy);
diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c
index 4573e3ceb11..a6a4bd60d03 100644
--- a/lib/libc/string/memchr.c
+++ b/lib/libc/string/memchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memchr.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: memchr.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -46,3 +46,4 @@ memchr(const void *s, int c, size_t n)
}
return (NULL);
}
+DEF_STRONG(memchr);
diff --git a/lib/libc/string/memcmp.c b/lib/libc/string/memcmp.c
index 49384a6fb99..0df2c54d2af 100644
--- a/lib/libc/string/memcmp.c
+++ b/lib/libc/string/memcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memcmp.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: memcmp.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -49,3 +49,4 @@ memcmp(const void *s1, const void *s2, size_t n)
}
return (0);
}
+DEF_STRONG(memcmp);
diff --git a/lib/libc/string/memcpy.c b/lib/libc/string/memcpy.c
index 1b9715e4717..73136edd722 100644
--- a/lib/libc/string/memcpy.c
+++ b/lib/libc/string/memcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memcpy.c,v 1.1 2014/11/30 19:43:56 deraadt Exp $ */
+/* $OpenBSD: memcpy.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -97,3 +97,4 @@ memcpy(void *dst0, const void *src0, size_t length)
done:
return (dst0);
}
+DEF_STRONG(memcpy);
diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c
index 5793a7dfd75..823443b08a6 100644
--- a/lib/libc/string/memmem.c
+++ b/lib/libc/string/memmem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmem.c,v 1.3 2013/05/30 01:10:45 ajacoutot Exp $ */
+/* $OpenBSD: memmem.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 2005 Pascal Gloor <pascal.gloor@spale.com>
*
@@ -61,3 +61,4 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
return NULL;
}
+DEF_WEAK(memmem);
diff --git a/lib/libc/string/memmove.c b/lib/libc/string/memmove.c
index 1baad535440..2f1deb2c70d 100644
--- a/lib/libc/string/memmove.c
+++ b/lib/libc/string/memmove.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memmove.c,v 1.1 2014/11/30 19:43:56 deraadt Exp $ */
+/* $OpenBSD: memmove.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -110,3 +110,4 @@ memmove(void *dst0, const void *src0, size_t length)
done:
return (dst0);
}
+DEF_STRONG(memmove);
diff --git a/lib/libc/string/memrchr.c b/lib/libc/string/memrchr.c
index bd27ebc620e..26a33995b70 100644
--- a/lib/libc/string/memrchr.c
+++ b/lib/libc/string/memrchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memrchr.c,v 1.2 2007/11/27 16:22:12 martynas Exp $ */
+/* $OpenBSD: memrchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -36,3 +36,4 @@ memrchr(const void *s, int c, size_t n)
}
return(NULL);
}
+DEF_WEAK(memrchr);
diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c
index 61709c139de..242529ee0f2 100644
--- a/lib/libc/string/memset.c
+++ b/lib/libc/string/memset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memset.c,v 1.6 2008/03/15 21:40:39 ray Exp $ */
+/* $OpenBSD: memset.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -45,3 +45,4 @@ memset(void *dst, int c, size_t n)
}
return (dst);
}
+DEF_STRONG(memset);
diff --git a/lib/libc/string/stpncpy.c b/lib/libc/string/stpncpy.c
index c7c2a57c4cd..6bdee5de164 100644
--- a/lib/libc/string/stpncpy.c
+++ b/lib/libc/string/stpncpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: stpncpy.c,v 1.2 2012/07/11 10:44:59 naddy Exp $ */
+/* $OpenBSD: stpncpy.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -54,3 +54,4 @@ stpncpy(char *dst, const char *src, size_t n)
}
return (dst);
}
+DEF_WEAK(stpncpy);
diff --git a/lib/libc/string/strcasecmp.c b/lib/libc/string/strcasecmp.c
index 2be09136c07..edbd638722e 100644
--- a/lib/libc/string/strcasecmp.c
+++ b/lib/libc/string/strcasecmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcasecmp.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcasecmp.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -85,6 +85,7 @@ strcasecmp(const char *s1, const char *s2)
return (0);
return (cm[*us1] - cm[*--us2]);
}
+DEF_WEAK(strcasecmp);
int
strncasecmp(const char *s1, const char *s2, size_t n)
@@ -103,3 +104,4 @@ strncasecmp(const char *s1, const char *s2, size_t n)
}
return (0);
}
+DEF_WEAK(strncasecmp);
diff --git a/lib/libc/string/strcasestr.c b/lib/libc/string/strcasestr.c
index aa74c0176dc..abb3e155491 100644
--- a/lib/libc/string/strcasestr.c
+++ b/lib/libc/string/strcasestr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcasestr.c,v 1.3 2006/03/31 05:34:55 deraadt Exp $ */
+/* $OpenBSD: strcasestr.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
/* $NetBSD: strcasestr.c,v 1.2 2005/02/09 21:35:47 kleink Exp $ */
/*-
@@ -58,3 +58,4 @@ strcasestr(const char *s, const char *find)
}
return ((char *)s);
}
+DEF_WEAK(strcasestr);
diff --git a/lib/libc/string/strchr.c b/lib/libc/string/strchr.c
index 596e407c9bd..b396b45b3b0 100644
--- a/lib/libc/string/strchr.c
+++ b/lib/libc/string/strchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strchr.c,v 1.2 2015/05/15 22:29:37 millert Exp $ */
+/* $OpenBSD: strchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -43,3 +43,4 @@ strchr(const char *p, int ch)
}
/* NOTREACHED */
}
+DEF_STRONG(strchr);
diff --git a/lib/libc/string/strcmp.c b/lib/libc/string/strcmp.c
index d1b6c50d791..be175563d47 100644
--- a/lib/libc/string/strcmp.c
+++ b/lib/libc/string/strcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strcmp.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -45,3 +45,4 @@ strcmp(const char *s1, const char *s2)
return (0);
return (*(unsigned char *)s1 - *(unsigned char *)--s2);
}
+DEF_STRONG(strcmp);
diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c
index 2df983bd652..47a6ea4f24e 100644
--- a/lib/libc/string/strcoll.c
+++ b/lib/libc/string/strcoll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcoll.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcoll.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -42,3 +42,4 @@ strcoll(const char *s1, const char *s2)
/* LC_COLLATE is unimplemented, hence always "C" */
return (strcmp(s1, s2));
}
+DEF_STRONG(strcoll);
diff --git a/lib/libc/string/strcspn.c b/lib/libc/string/strcspn.c
index 1eb233614d0..3c1f5a4ceca 100644
--- a/lib/libc/string/strcspn.c
+++ b/lib/libc/string/strcspn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strcspn.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strcspn.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -56,3 +56,4 @@ strcspn(const char *s1, const char *s2)
}
/* NOTREACHED */
}
+DEF_STRONG(strcspn);
diff --git a/lib/libc/string/strdup.c b/lib/libc/string/strdup.c
index a6aa1e03b0f..9aebf399c14 100644
--- a/lib/libc/string/strdup.c
+++ b/lib/libc/string/strdup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strdup.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strdup.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -47,3 +47,4 @@ strdup(const char *str)
(void)memcpy(copy, str, siz);
return(copy);
}
+DEF_WEAK(strdup);
diff --git a/lib/libc/string/strerror.c b/lib/libc/string/strerror.c
index 13996f08e98..c6f05446fd9 100644
--- a/lib/libc/string/strerror.c
+++ b/lib/libc/string/strerror.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strerror.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strerror.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -39,3 +39,4 @@ strerror(int num)
(void)strerror_r(num, buf, sizeof(buf));
return (buf);
}
+DEF_STRONG(strerror);
diff --git a/lib/libc/string/strerror_r.c b/lib/libc/string/strerror_r.c
index b85136055b1..90aa012360d 100644
--- a/lib/libc/string/strerror_r.c
+++ b/lib/libc/string/strerror_r.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strerror_r.c,v 1.8 2013/06/01 21:26:18 stsp Exp $ */
+/* $OpenBSD: strerror_r.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/* Public Domain <marc@snafu.org> */
#ifdef NLS
@@ -125,6 +125,7 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen)
errno = ret_errno ? ret_errno : save_errno;
return (ret_errno);
}
+DEF_WEAK(strerror_r);
#define USIGPREFIX "Unknown signal: "
diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c
index 14c53a1f69c..073b0d42594 100644
--- a/lib/libc/string/strlcat.c
+++ b/lib/libc/string/strlcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlcat.c,v 1.15 2015/03/02 21:41:08 millert Exp $ */
+/* $OpenBSD: strlcat.c,v 1.16 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -53,3 +53,4 @@ strlcat(char *dst, const char *src, size_t dsize)
return(dlen + (src - osrc)); /* count does not include NUL */
}
+DEF_WEAK(strlcat);
diff --git a/lib/libc/string/strlcpy.c b/lib/libc/string/strlcpy.c
index e9a7fe4be73..5fcf084aaad 100644
--- a/lib/libc/string/strlcpy.c
+++ b/lib/libc/string/strlcpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */
+/* $OpenBSD: strlcpy.c,v 1.13 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1998, 2015 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -48,3 +48,4 @@ strlcpy(char *dst, const char *src, size_t dsize)
return(src - osrc - 1); /* count does not include NUL */
}
+DEF_WEAK(strlcpy);
diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c
index 7e0e27b1d8d..a5721d3e7f5 100644
--- a/lib/libc/string/strlen.c
+++ b/lib/libc/string/strlen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlen.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strlen.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -41,3 +41,4 @@ strlen(const char *str)
return (s - str);
}
+DEF_STRONG(strlen);
diff --git a/lib/libc/string/strmode.c b/lib/libc/string/strmode.c
index 6f0fa34ed87..609b8931fbb 100644
--- a/lib/libc/string/strmode.c
+++ b/lib/libc/string/strmode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strmode.c,v 1.7 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strmode.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -138,3 +138,4 @@ strmode(int mode, char *p)
*p++ = ' '; /* will be a '+' if ACL's implemented */
*p = '\0';
}
+DEF_WEAK(strmode);
diff --git a/lib/libc/string/strncat.c b/lib/libc/string/strncat.c
index c4df4f2fad6..b3388accf37 100644
--- a/lib/libc/string/strncat.c
+++ b/lib/libc/string/strncat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncat.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strncat.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -55,3 +55,4 @@ strncat(char *dst, const char *src, size_t n)
}
return (dst);
}
+DEF_STRONG(strncat);
diff --git a/lib/libc/string/strncmp.c b/lib/libc/string/strncmp.c
index 0a4ddc1d9e3..535d2a60fde 100644
--- a/lib/libc/string/strncmp.c
+++ b/lib/libc/string/strncmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncmp.c,v 1.8 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strncmp.c,v 1.9 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -45,3 +45,4 @@ strncmp(const char *s1, const char *s2, size_t n)
} while (--n != 0);
return (0);
}
+DEF_STRONG(strncmp);
diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c
index 5003a199a9b..d6d8647fc76 100644
--- a/lib/libc/string/strncpy.c
+++ b/lib/libc/string/strncpy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strncpy.c,v 1.7 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strncpy.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -56,3 +56,4 @@ strncpy(char *dst, const char *src, size_t n)
}
return (dst);
}
+DEF_STRONG(strncpy);
diff --git a/lib/libc/string/strndup.c b/lib/libc/string/strndup.c
index 27701ac555a..a6e5bff7ca1 100644
--- a/lib/libc/string/strndup.c
+++ b/lib/libc/string/strndup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strndup.c,v 1.1 2010/05/18 22:24:55 tedu Exp $ */
+/* $OpenBSD: strndup.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -37,3 +37,4 @@ strndup(const char *str, size_t maxlen)
return copy;
}
+DEF_WEAK(strndup);
diff --git a/lib/libc/string/strnlen.c b/lib/libc/string/strnlen.c
index 872cfa6ccea..26e9743f183 100644
--- a/lib/libc/string/strnlen.c
+++ b/lib/libc/string/strnlen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strnlen.c,v 1.5 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: strnlen.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -30,3 +30,4 @@ strnlen(const char *str, size_t maxlen)
return (size_t)(cp - str);
}
+DEF_WEAK(strnlen);
diff --git a/lib/libc/string/strpbrk.c b/lib/libc/string/strpbrk.c
index cd3b71c0d3e..336c22dedd6 100644
--- a/lib/libc/string/strpbrk.c
+++ b/lib/libc/string/strpbrk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strpbrk.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strpbrk.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
@@ -46,3 +46,4 @@ strpbrk(const char *s1, const char *s2)
}
return (NULL);
}
+DEF_STRONG(strpbrk);
diff --git a/lib/libc/string/strrchr.c b/lib/libc/string/strrchr.c
index 181f56ea698..93755721443 100644
--- a/lib/libc/string/strrchr.c
+++ b/lib/libc/string/strrchr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strrchr.c,v 1.2 2015/05/15 22:29:37 millert Exp $ */
+/* $OpenBSD: strrchr.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -45,3 +45,4 @@ strrchr(const char *p, int ch)
}
/* NOTREACHED */
}
+DEF_STRONG(strrchr);
diff --git a/lib/libc/string/strsep.c b/lib/libc/string/strsep.c
index 2ffc4b4c46a..97c3cbf1f5d 100644
--- a/lib/libc/string/strsep.c
+++ b/lib/libc/string/strsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strsep.c,v 1.7 2014/02/05 20:42:32 stsp Exp $ */
+/* $OpenBSD: strsep.c,v 1.8 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -68,3 +68,4 @@ strsep(char **stringp, const char *delim)
}
/* NOTREACHED */
}
+DEF_WEAK(strsep);
diff --git a/lib/libc/string/strsignal.c b/lib/libc/string/strsignal.c
index aa541cefede..a71a291fbc0 100644
--- a/lib/libc/string/strsignal.c
+++ b/lib/libc/string/strsignal.c
@@ -39,3 +39,4 @@ strsignal(int sig)
return __strsignal(sig, buf);
}
+DEF_WEAK(strsignal);
diff --git a/lib/libc/string/strspn.c b/lib/libc/string/strspn.c
index 385649c0419..0ce41cbb49b 100644
--- a/lib/libc/string/strspn.c
+++ b/lib/libc/string/strspn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strspn.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strspn.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
* All rights reserved.
@@ -49,3 +49,4 @@ cont:
goto cont;
return (p - 1 - s1);
}
+DEF_STRONG(strspn);
diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c
index 95a865bf791..ccd08717005 100644
--- a/lib/libc/string/strstr.c
+++ b/lib/libc/string/strstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strstr.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strstr.c,v 1.6 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -54,3 +54,4 @@ strstr(const char *s, const char *find)
}
return ((char *)s);
}
+DEF_STRONG(strstr);
diff --git a/lib/libc/string/strtok.c b/lib/libc/string/strtok.c
index 6ba6b21cd6f..c5765756fcd 100644
--- a/lib/libc/string/strtok.c
+++ b/lib/libc/string/strtok.c
@@ -36,6 +36,7 @@ strtok(char *s, const char *delim)
return strtok_r(s, delim, &last);
}
+DEF_STRONG(strtok);
char *
strtok_r(char *s, const char *delim, char **last)
@@ -83,3 +84,4 @@ cont:
}
/* NOTREACHED */
}
+DEF_WEAK(strtok_r);
diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c
index 6f289c901ec..97df097b296 100644
--- a/lib/libc/string/strxfrm.c
+++ b/lib/libc/string/strxfrm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strxfrm.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */
+/* $OpenBSD: strxfrm.c,v 1.7 2015/08/31 02:53:57 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -49,3 +49,4 @@ strxfrm(char *dst, const char *src, size_t n)
return (strlen(src));
return (strlcpy(dst, src, n));
}
+DEF_STRONG(strxfrm);
diff --git a/lib/libc/string/timingsafe_bcmp.c b/lib/libc/string/timingsafe_bcmp.c
index 0b736154ca8..0409ec32448 100644
--- a/lib/libc/string/timingsafe_bcmp.c
+++ b/lib/libc/string/timingsafe_bcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timingsafe_bcmp.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */
+/* $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2010 Damien Miller. All rights reserved.
*
@@ -27,3 +27,4 @@ timingsafe_bcmp(const void *b1, const void *b2, size_t n)
ret |= *p1++ ^ *p2++;
return (ret != 0);
}
+DEF_WEAK(timingsafe_bcmp);
diff --git a/lib/libc/string/timingsafe_memcmp.c b/lib/libc/string/timingsafe_memcmp.c
index 04e2ac5e206..373f8cb1978 100644
--- a/lib/libc/string/timingsafe_memcmp.c
+++ b/lib/libc/string/timingsafe_memcmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: timingsafe_memcmp.c,v 1.1 2014/06/13 02:12:17 matthew Exp $ */
+/* $OpenBSD: timingsafe_memcmp.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */
/*
* Copyright (c) 2014 Google Inc.
*
@@ -44,3 +44,4 @@ timingsafe_memcmp(const void *b1, const void *b2, size_t len)
return (res);
}
+DEF_WEAK(timingsafe_memcmp);