2012-08-16 02:38:57 +08:00
|
|
|
/* Multiple versions of strstr.
|
2012-10-10 22:49:12 +08:00
|
|
|
All versions must be listed in ifunc-impl-list.c.
|
2013-01-03 03:01:50 +08:00
|
|
|
Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
2012-08-16 02:38:57 +08:00
|
|
|
This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
/* Redefine strstr so that the compiler won't complain about the type
|
|
|
|
mismatch with the IFUNC selector in strong_alias, below. */
|
|
|
|
#undef strstr
|
|
|
|
#define strstr __redirect_strstr
|
|
|
|
#include <string.h>
|
|
|
|
#undef strstr
|
2009-07-21 12:06:50 +08:00
|
|
|
|
|
|
|
#define STRSTR __strstr_sse2
|
2009-10-07 11:01:23 +08:00
|
|
|
#ifdef SHARED
|
|
|
|
# undef libc_hidden_builtin_def
|
|
|
|
# define libc_hidden_builtin_def(name) \
|
2009-07-21 12:06:50 +08:00
|
|
|
__hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
|
2009-10-07 11:01:23 +08:00
|
|
|
#endif
|
2009-07-21 12:06:50 +08:00
|
|
|
|
|
|
|
#include "string/strstr.c"
|
|
|
|
|
2012-08-10 07:04:37 +08:00
|
|
|
extern __typeof (__redirect_strstr) __strstr_sse42 attribute_hidden;
|
|
|
|
extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden;
|
|
|
|
|
2012-08-16 02:38:57 +08:00
|
|
|
#include "init-arch.h"
|
|
|
|
|
2012-08-10 07:04:37 +08:00
|
|
|
/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
|
|
|
ifunc symbol properly. */
|
|
|
|
extern __typeof (__redirect_strstr) __libc_strstr;
|
|
|
|
libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2)
|
2009-07-21 12:06:50 +08:00
|
|
|
|
2012-08-10 07:04:37 +08:00
|
|
|
#undef strstr
|
|
|
|
strong_alias (__libc_strstr, strstr)
|