Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / x86_64 / multiarch / strstr.c
blob507994bd38566c0e04e6607f6b89f2a2b81a407e
1 /* Multiple versions of strstr.
2 All versions must be listed in ifunc-impl-list.c.
3 Copyright (C) 2012-2015 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 /* Redefine strstr so that the compiler won't complain about the type
21 mismatch with the IFUNC selector in strong_alias, below. */
22 #undef strstr
23 #define strstr __redirect_strstr
24 #include <string.h>
25 #undef strstr
27 #define STRSTR __strstr_sse2
28 #ifdef SHARED
29 # undef libc_hidden_builtin_def
30 # define libc_hidden_builtin_def(name) \
31 __hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
32 #endif
34 #include "string/strstr.c"
36 extern __typeof (__redirect_strstr) __strstr_sse2_unaligned attribute_hidden;
37 extern __typeof (__redirect_strstr) __strstr_sse2 attribute_hidden;
39 #include "init-arch.h"
41 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
42 ifunc symbol properly. */
43 extern __typeof (__redirect_strstr) __libc_strstr;
44 libc_ifunc (__libc_strstr, HAS_FAST_UNALIGNED_LOAD ? __strstr_sse2_unaligned : __strstr_sse2)
46 #undef strstr
47 strong_alias (__libc_strstr, strstr)