This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Add ifunc attribute


On Sat, Jun 13, 2009 at 8:15 AM, Richard
Guenther<richard.guenther@gmail.com> wrote:

>>
>> I started to write my own version of the documentation, but I realized
>> that I don't even understand this. ?Which function is called by the
>> dynamic linker, "f" or "f_ifunc"? ?Why is the attribute ignored if
>> "f_ifunc" is not defined; shouldn't it be an error? ?I guess that means
>> that "f_ifunc" is called by the dynamic linker; in that case, what
>> happens if "func" is defined?
>
> Yeah. ?I would have proposed that
>
> void *foo (void) __attribute__((__ifunc__))
> {
> ?return zero;
> }
>
> would simply generate foo with indirect function type.
>
> This of course causes a problem if you have a declaration for
> the real foo available - but then you should better not have that,
> as the compiler will then derive wrong properties for the real foo
> from the ifunc wrapper body.
>

Glibc has ifunc testcases with a declaration of foo in the same file.
This proposal won't work with them.

---
H.J.


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