This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: invalid IFUNC DW_AT_linkage_name: memmove strstr time


> diff --git a/sysdeps/i386/i686/multiarch/strstr-c.c b/sysdeps/i386/i686/multiarch/strstr-c.c
> index 1fcb00e..cbb2d8c 100644
> --- a/sysdeps/i386/i686/multiarch/strstr-c.c
> +++ b/sysdeps/i386/i686/multiarch/strstr-c.c
> @@ -5,11 +5,17 @@
>  #undef libc_hidden_builtin_def
>  #define libc_hidden_builtin_def(name) \
>    __hidden_ver1 (__strstr_ia32, __GI_strstr, __strstr_ia32);
> +#undef strstr
> +#define strstr __redirect_strstr

What are these lines doing?  I guess they are to avoid seeing the normal
<string.h> declaration of strstr so the compiler doesn't complain about the
type mismatch when it's defined by strong_alias.  Since it's a subtle
weirdness, it requires a comment.  Since they aren't directly related to
the libc_hidden_builtin_def bit, separate from that with a blank line.

> -libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_ia32);
> +libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_ia32);

No trailing ; after libc_ifunc (it was wrong here before).

> +#undef strstr
> +strong_alias (__libc_strstr, strstr);

No trailing ; after strong_alias.

> +# undef time
> +# define time __redirect_time
> +# include <time.h>

Again, needs comment.

> +# include <dl-vdso.h>

Why is this needed?

> @@ -28,22 +28,28 @@
>  # undef libc_hidden_builtin_def
>  # define libc_hidden_builtin_def(name) \
>    __hidden_ver1 (__memmove_sse2, __GI_memmove, __memmove_sse2);
> +# undef memmove
> +# define memmove __redirect_memmove

Blank line, comment.

> -extern __typeof (memmove) __memmove_sse2 attribute_hidden;
> -extern __typeof (memmove) __memmove_ssse3 attribute_hidden;
> -extern __typeof (memmove) __memmove_ssse3_back attribute_hidden;
> +extern void *__memmove_sse2 (void *, const void *, size_t) attribute_hidden;
> +extern __typeof (__memmove_sse2) __memmove_ssse3 attribute_hidden;
> +extern __typeof (__memmove_sse2) __memmove_ssse3_back attribute_hidden;

It should still use __typeof throughout.  
You can just refer to __redirect_memmove now.

> +extern __typeof (__memmove_sse2) __libc_memmove;

And here.

> +strong_alias (__libc_memmove, memmove);

No trailing ;.

> @@ -5,11 +5,17 @@
>  # undef libc_hidden_builtin_def
>  # define libc_hidden_builtin_def(name) \
>    __hidden_ver1 (__strstr_sse2, __GI_strstr, __strstr_sse2);
> +# undef strstr
> +# define strstr __redirect_strstr

Blank line, comment.

>  #endif
>  
>  #include "string/strstr.c"
>  
>  extern char *__strstr_sse42 (const char *, const char *) attribute_hidden;
>  extern __typeof (__strstr_sse2) __strstr_sse2 attribute_hidden;
> +extern __typeof (__strstr_sse2) __libc_strstr;

Change these to all use __typeof (__redirect_strstr).

> -libc_ifunc (strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2);
> +libc_ifunc (__libc_strstr, HAS_SSE4_2 ? __strstr_sse42 : __strstr_sse2);
> +
> +#undef strstr
> +strong_alias (__libc_strstr, strstr);

No trailing ; on libc_ifunc and strong_alias.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]