PING: PATCH: Automatically test IFUNC implementations
Roland McGrath
roland@hack.frob.com
Tue Oct 9 20:36:00 GMT 2012
> +extern void *__memcpy_chk (void *, const void *, size_t, size_t);
> +extern void *__memmove_chk (void *, const void *, size_t, size_t);
> +extern void *__mempcpy_chk (void *, const void *, size_t, size_t);
> +extern void *__memset_chk (void *, int c, size_t, size_t);
These declarations are already in include/string.h. In general, you should
never have a local extern declaration like this. If it's not superfluous,
it means that there is no checking that the signature is correct. So, if
you seem to need it, then what you really need is to include some other
header file that contains the declaration, or else to add it to some header
file and ensure that the definition sites include that header too.
> +#define FIND_FUNC(func, cond, impl) \
> + if (cond) \
> + { \
> + extern __typeof (func) impl attribute_hidden; \
> + array[i++] = LIBC_FUNC_INIT (impl); \
> + }
> +
> + /* Return the number of IFUNC implementations supported on target
> + machine. */
> +#define FUNC_FINDER(func, ...) \
> + if (strcmp (name, #func) == 0) \
> + { \
> + __VA_ARGS__; \
> + return i; \
> + }
Put these macros in the common header file so other machines'
implementations can use them too.
These patches do not include adding comments where each selector is defined
reminding us to keep the implementation-list implementation up to date.
Thanks,
Roland
More information about the Libc-alpha
mailing list