diff --git a/string/rawmemchr.c b/string/rawmemchr.c
index fa3176d6ac7e25490be415af0459807509d1e02b..1a146af980619ac9a37a3c9d8df3917e7ce5db12 100644
--- a/string/rawmemchr.c
+++ b/string/rawmemchr.c
@@ -1,10 +1,5 @@
Â /* Copyright (C) 1991-2016 Free Software Foundation, Inc.
Â Â Â  This file is part of the GNU C Library.
-Â Â  Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
-Â Â  with help from Dan Sahlin (dan@sics.se) and
-Â Â  commentary by Jim Blandy (jimb@ai.mit.edu);
-Â Â  adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
-Â Â  and implemented by Roland McGrath (roland@ai.mit.edu).
Â 
Â Â Â  The GNU C Library is free software; you can redistribute it and/or
Â Â Â  modify it under the terms of the GNU Lesser General Public
@@ -20,157 +15,19 @@
Â Â Â  License along with the GNU C Library; if not, see
Â Â Â  <http://www.gnu.org/licenses/>.Â  */
Â 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#undef __ptr_t
-#define __ptr_t void *
-
-#if defined (_LIBC)
-# include <string.h>
-# include <memcopy.h>
-# include <stdlib.h>
-#endif
-
-#if defined (HAVE_LIMITS_H) || defined (_LIBC)
-# include <limits.h>
-#endif
-
-#define LONG_MAX_32_BITS 2147483647
-
-#ifndef LONG_MAX
-#define LONG_MAX LONG_MAX_32_BITS
-#endif
-
-#include <sys/types.h>
-
-#undef memchr
+#include <string.h>
Â 
Â #ifndef RAWMEMCHR
Â # define RAWMEMCHR __rawmemchr
Â #endif
Â 
Â /* Find the first occurrence of C in S.Â  */
-__ptr_t
-RAWMEMCHR (const __ptr_t s, int c_in)
+void *
+RAWMEMCHR (const void *s, int c)
Â {
-Â  const unsigned char *char_ptr;
-Â  const unsigned long int *longword_ptr;
-Â  unsigned long int longword, magic_bits, charmask;
-Â  unsigned char c;
-
-Â  c = (unsigned char) c_in;
-
-Â  /* Handle the first few characters by reading one character at a time.
-Â Â Â Â  Do this until CHAR_PTR is aligned on a longword boundary.Â  */
-Â  for (char_ptr = (const unsigned char *) s;
-Â Â Â Â Â Â  ((unsigned long int) char_ptr & (sizeof (longword) - 1)) != 0;
-Â Â Â Â Â Â  ++char_ptr)
-Â Â Â  if (*char_ptr == c)
-Â Â Â Â Â  return (__ptr_t) char_ptr;
-
-Â  /* All these elucidatory comments refer to 4-byte longwords,
-Â Â Â Â  but the theory applies equally well to 8-byte longwords.Â  */
-
-Â  longword_ptr = (unsigned long int *) char_ptr;
-
-Â  /* Bits 31, 24, 16, and 8 of this number are zero.Â  Call these bits
-Â Â Â Â  the "holes."Â  Note that there is a hole just to the left of
-Â Â Â Â  each byte, with an extra at the end:
-
-Â Â Â Â  bits:Â  01111110 11111110 11111110 11111111
-Â Â Â Â  bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
-
-Â Â Â Â  The 1-bits make sure that carries propagate to the next 0-bit.
-Â Â Â Â  The 0-bits provide holes for carries to fall into.Â  */
-Â  magic_bits = -1;
-Â  magic_bits = magic_bits / 0xff * 0xfe << 1 >> 1 | 1;
-
-Â  /* Set up a longword, each of whose bytes is C.Â  */
-Â  charmask = c | (c << 8);
-Â  charmask |= charmask << 16;
-#if LONG_MAX > LONG_MAX_32_BITS
-Â  charmask |= charmask << 32;
-#endif
-
-Â  /* Instead of the traditional loop which tests each character,
-Â Â Â Â  we will test a longword at a time.Â  The tricky part is testing
-Â Â Â Â  if *any of the four* bytes in the longword in question are zero.Â  */
-Â  while (1)
-Â Â Â  {
-Â Â Â Â Â  /* We tentatively exit the loop if adding MAGIC_BITS to
-Â Â Â Â Â Â Â  LONGWORD fails to change any of the hole bits of LONGWORD.
-
-Â Â Â Â Â Â Â  1) Is this safe?Â  Will it catch all the zero bytes?
-Â Â Â Â Â Â Â  Suppose there is a byte with all zeros.Â  Any carry bits
-Â Â Â Â Â Â Â  propagating from its left will fall into the hole at its
-Â Â Â Â Â Â Â  least significant bit and stop.Â  Since there will be no
-Â Â Â Â Â Â Â  carry from its most significant bit, the LSB of the
-Â Â Â Â Â Â Â  byte to the left will be unchanged, and the zero will be
-Â Â Â Â Â Â Â  detected.
-
-Â Â Â Â Â Â Â  2) Is this worthwhile?Â  Will it ignore everything except
-Â Â Â Â Â Â Â  zero bytes?Â  Suppose every byte of LONGWORD has a bit set
-Â Â Â Â Â Â Â  somewhere.Â  There will be a carry into bit 8.Â  If bit 8
-Â Â Â Â Â Â Â  is set, this will carry into bit 16.Â  If bit 8 is clear,
-Â Â Â Â Â Â Â  one of bits 9-15 must be set, so there will be a carry
-Â Â Â Â Â Â Â  into bit 16.Â  Similarly, there will be a carry into bit
-Â Â Â Â Â Â Â  24.Â  If one of bits 24-30 is set, there will be a carry
-Â Â Â Â Â Â Â  into bit 31, so all of the hole bits will be changed.
-
-Â Â Â Â Â Â Â  The one misfire occurs when bits 24-30 are clear and bit
-Â Â Â Â Â Â Â  31 is set; in this case, the hole at bit 31 is not
-Â Â Â Â Â Â Â  changed.Â  If we had access to the processor carry flag,
-Â Â Â Â Â Â Â  we could close this loophole by putting the fourth hole
-Â Â Â Â Â Â Â  at bit 32!
-
-Â Â Â Â Â Â Â  So it ignores everything except 128's, when they're aligned
-Â Â Â Â Â Â Â  properly.
-
-Â Â Â Â Â Â Â  3) But wait!Â  Aren't we looking for C, not zero?
-Â Â Â Â Â Â Â  Good point.Â  So what we do is XOR LONGWORD with a longword,
-Â Â Â Â Â Â Â  each of whose bytes is C.Â  This turns each byte that is C
-Â Â Â Â Â Â Â  into a zero.Â  */
-
-Â Â Â Â Â  longword = *longword_ptr++ ^ charmask;
-
-Â Â Â Â Â  /* Add MAGIC_BITS to LONGWORD.Â  */
-Â Â Â Â Â  if ((((longword + magic_bits)
-
-Â Â Â Â Â Â Â Â Â Â  /* Set those bits that were unchanged by the addition.Â  */
-Â Â Â Â Â Â Â Â Â Â  ^ ~longword)
-
-Â Â Â Â Â Â Â Â Â  /* Look at only the hole bits.Â  If any of the hole bits
-Â Â Â Â Â Â Â Â Â Â Â Â  are unchanged, most likely one of the bytes was a
-Â Â Â Â Â Â Â Â Â Â Â Â  zero.Â  */
-Â Â Â Â Â Â Â Â Â  & ~magic_bits) != 0)
-Â Â Â Â Â Â  {
-Â Â Â Â Â Â Â Â  /* Which of the bytes was C?Â  If none of them were, it was
-Â Â Â Â Â Â Â Â Â Â Â  a misfire; continue the search.Â  */
-
-Â Â Â Â Â Â Â Â  const unsigned char *cp = (const unsigned char *) (longword_ptr - 1);
-
-Â Â Â Â Â Â Â Â  if (cp[0] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) cp;
-Â Â Â Â Â Â Â Â  if (cp[1] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[1];
-Â Â Â Â Â Â Â Â  if (cp[2] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[2];
-Â Â Â Â Â Â Â Â  if (cp[3] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[3];
-#if LONG_MAX > 2147483647
-Â Â Â Â Â Â Â Â  if (cp[4] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[4];
-Â Â Â Â Â Â Â Â  if (cp[5] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[5];
-Â Â Â Â Â Â Â Â  if (cp[6] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[6];
-Â Â Â Â Â Â Â Â  if (cp[7] == c)
-Â Â Â Â Â Â Â Â Â Â  return (__ptr_t) &cp[7];
-#endif
-Â Â Â Â Â Â  }
-Â Â Â  }
+Â  if (c != '\0')
+Â Â Â  return memchr (s, c, (size_t)-1);
+Â  return (char *)s + strlen (s);
Â }
Â libc_hidden_def (__rawmemchr)
Â weak_alias (__rawmemchr, rawmemchr)
