This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: indirect function support
On Mon, May 24, 2010 at 7:52 AM, Nathan Sidwell <nathan@codesourcery.com> wrote:
> On 05/24/10 15:11, H.J. Lu wrote:
>
>> I am not sure what real benefit your proposal brings to the table. See my
>> followup at:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01384.html
>
> You've hidden the glibc implementation behind some unrevealed macros.
> Those macros will be non-standard, forcing every library that wishes to use
> ifunc features to reinvent them.
>
> Furthermore, I presume it is easier to write a function as a regular
> function body, rather than as a single operand to the libm_ifunc macro
> you're invoking.
>
The macro used in glibc is to implement to
--
void * foo_ifunc (void) __asm__ ("foo");
__asm__(".type foo, %gnu_indirect_function");
void *
foo_ifunc (void)
{
return function address;
}
----
Your proposal doesn't solve 2 flaws in the current implementation:
1. There is no type check.
2. Programmers have to know what the symbol name is at assembly level,
which makes it hard to use, especially in C++ template.
--
H.J.