File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1+ 2017-09-21 Martin Sebor <
[email protected] >
2+
3+ * PR c/81882
4+ * doc/extend.texi (attribute ifunc): Avoid relying on ill-formed
5+ code (in C++) or code that triggers warnings.
6+
172017-09-21 Eric Botcazou <
[email protected] >
28
39 * stor-layout.c (bit_from_pos): Do not distribute the conversion.
Original file line number Diff line number Diff line change @@ -2783,21 +2783,23 @@ The @code{ifunc} attribute is used to mark a function as an indirect
27832783function using the STT_GNU_IFUNC symbol type extension to the ELF
27842784standard. This allows the resolution of the symbol value to be
27852785determined dynamically at load time, and an optimized version of the
2786- routine can be selected for the particular processor or other system
2786+ routine to be selected for the particular processor or other system
27872787characteristics determined then. To use this attribute, first define
27882788the implementation functions available, and a resolver function that
27892789returns a pointer to the selected implementation function. The
27902790implementation functions' declarations must match the API of the
2791- function being implemented, the resolver's declaration is be a
2792- function returning pointer to void function returning void:
2791+ function being implemented. The resolver should be declared to
2792+ be a function taking no arguments and returning a pointer to
2793+ a function of the same type as the implementation. For example:
27932794
27942795@smallexample
27952796void *my_memcpy (void *dst, const void *src, size_t len)
27962797@{
27972798 @dots{}
2799+ return dst;
27982800@}
27992801
2800- static void (*resolve_memcpy (void)) (void)
2802+ static void * (*resolve_memcpy (void))(void *, const void *, size_t )
28012803@{
28022804 return my_memcpy; // we'll just always select this routine
28032805@}
You can’t perform that action at this time.
0 commit comments