This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.20-179-g9975e3d
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 12 Nov 2014 22:41:33 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.20-179-g9975e3d
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 9975e3d37d8585b41db075321bade3495cf58cdb (commit)
from c4eae75271734f820a7477dbce33f8752af6f003 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9975e3d37d8585b41db075321bade3495cf58cdb
commit 9975e3d37d8585b41db075321bade3495cf58cdb
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Nov 12 22:41:03 2014 +0000
Fix locale memmem namespace (bug 17585).
Locale code, brought in by ISO C functions, calls memmem, which is not
an ISO C function. This isn't an ISO C conformance bug, because all
mem* names are reserved, but glibc practice is not to rely on that
reservation (thus, memmem is only declared in string.h if __USE_GNU
even though ISO C would allow it to be declared unconditionally, for
example). This patch changes that code to use __memmem.
Note: there are uses of memmem elsewhere in glibc that I didn't
change, although it may turn out some of those also need to use
__memmem.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).
[BZ #17585]
* string/memmem.c [!_LIBC] (__memmem): Define to memmem.
(memmem): Rename to __memmem and define as weak alias of
__memmem. Use libc_hidden_weak.
(__memmem): Use libc_hidden_def.
* include/string.h (__memmem): Declare. Use libc_hidden_proto.
* locale/findlocale.c (valid_locale_name): Use __memmem instead of
memmem.
diff --git a/ChangeLog b/ChangeLog
index 90ea96b..9ef0907 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2014-11-12 Joseph Myers <joseph@codesourcery.com>
+ [BZ #17585]
+ * string/memmem.c [!_LIBC] (__memmem): Define to memmem.
+ (memmem): Rename to __memmem and define as weak alias of
+ __memmem. Use libc_hidden_weak.
+ (__memmem): Use libc_hidden_def.
+ * include/string.h (__memmem): Declare. Use libc_hidden_proto.
+ * locale/findlocale.c (valid_locale_name): Use __memmem instead of
+ memmem.
+
[BZ #17582]
* libio/iofgets.c [weak_alias && !_IO_MTSAFE_IO]
(__fgets_unlocked): Add alias of _IO_fgets. Use libc_hidden_def.
diff --git a/NEWS b/NEWS
index 6ae72da..27969e0 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,7 @@ Version 2.21
6652, 12926, 14132, 14138, 14171, 15215, 15884, 17266, 17344, 17363,
17370, 17371, 17411, 17460, 17475, 17485, 17501, 17506, 17508, 17522,
- 17555, 17570, 17571, 17572, 17573, 17574, 17582, 17583, 17584.
+ 17555, 17570, 17571, 17572, 17573, 17574, 17582, 17583, 17584, 17585.
* New locales: tu_IN, bh_IN.
diff --git a/include/string.h b/include/string.h
index 2603e9c..99cc2d3 100644
--- a/include/string.h
+++ b/include/string.h
@@ -90,6 +90,8 @@ extern char *__strsep_g (char **__stringp, const char *__delim);
libc_hidden_proto (__strsep_g)
libc_hidden_proto (strnlen)
libc_hidden_proto (memmem)
+extern __typeof (memmem) __memmem;
+libc_hidden_proto (__memmem)
libc_hidden_proto (__ffs)
libc_hidden_builtin_proto (memchr)
diff --git a/locale/findlocale.c b/locale/findlocale.c
index 22e8b53..b64352c 100644
--- a/locale/findlocale.c
+++ b/locale/findlocale.c
@@ -79,8 +79,8 @@ valid_locale_name (const char *name)
return 0;
/* Directory traversal attempt. */
static const char slashdot[4] = {'/', '.', '.', '/'};
- if (__glibc_unlikely (memmem (name, namelen,
- slashdot, sizeof (slashdot)) != NULL))
+ if (__glibc_unlikely (__memmem (name, namelen,
+ slashdot, sizeof (slashdot)) != NULL))
return 0;
if (namelen == 2 && __glibc_unlikely (name[0] == '.' && name [1] == '.'))
return 0;
diff --git a/string/memmem.c b/string/memmem.c
index b2842fe..bafac03 100644
--- a/string/memmem.c
+++ b/string/memmem.c
@@ -26,6 +26,7 @@
#ifndef _LIBC
# define __builtin_expect(expr, val) (expr)
+# define __memmem memmem
#endif
#define RETURN_TYPE void *
@@ -38,8 +39,8 @@
if NEEDLE_LEN is 0, otherwise NULL if NEEDLE is not found in
HAYSTACK. */
void *
-memmem (const void *haystack_start, size_t haystack_len,
- const void *needle_start, size_t needle_len)
+__memmem (const void *haystack_start, size_t haystack_len,
+ const void *needle_start, size_t needle_len)
{
/* Abstract memory is considered to be an array of 'unsigned char' values,
not an array of 'char' values. See ISO C 99 section 6.2.6.1. */
@@ -73,6 +74,8 @@ memmem (const void *haystack_start, size_t haystack_len,
else
return two_way_long_needle (haystack, haystack_len, needle, needle_len);
}
-libc_hidden_def (memmem)
+libc_hidden_def (__memmem)
+weak_alias (__memmem, memmem)
+libc_hidden_weak (memmem)
#undef LONG_NEEDLE_THRESHOLD
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
NEWS | 2 +-
include/string.h | 2 ++
locale/findlocale.c | 4 ++--
string/memmem.c | 9 ++++++---
5 files changed, 20 insertions(+), 6 deletions(-)
hooks/post-receive
--
GNU C Library master sources