This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/40528] Add a new ifunc attribute
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2009 15:54:25 -0000
- Subject: [Bug c/40528] Add a new ifunc attribute
- References: <bug-40528-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from jakub at gcc dot gnu dot org 2009-06-24 15:54 -------
Option 2) is certainly the least intrusive in the compiler and you can use it
even with foo's prototype and calling it from the same CU, just use asm.
__typeof (foo) *
__attribute__ ((ifunc))
foo_ifunc (void) __asm ("foo")
{
<return address of foo_{1,2,3}>
}
If you don't have a prototype, you can use the variant originally mentioned in
option 2). Most users will wrap this stuff in a macro anyway and in that case
whether they use just an attribute or attribute and __asm is not a big deal.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40528