public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/40528]  New: Add a new ifunc attribute
@ 2009-06-23 17:17 hjl dot tools at gmail dot com
  2009-06-24  9:39 ` [Bug c/40528] " rguenth at gcc dot gnu dot org
                   ` (14 more replies)
  0 siblings, 15 replies; 18+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-06-23 17:17 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

Binutils and glibc implemented STT_GNU_IFUNC:

http://groups.google.com/group/generic-abi

A new ifunc attribute can provide user access to this
feature at C language level. Several options:

1. Ifunc attribute with argument:

int foo (…);

__typeof (foo) *
__attribute__ ((ifunc ("foo")))
foo_ifunc (void)
{
  <return address of foo_{1,2,3}>
}

foo_ifunc is a dummy place holder which isn't necessary.

2. Ifunc attribute without argument:

void *
__attribute__ ((ifunc))
foo (void)
{
  <return address of foo_{1,2,3}>
}

We can't call foo in the same file where foo is defined
since we need a different prototype when calling foo.

3. Ifunc attribute with prototype, but without argument:

int
__attribute__ ((ifunc))
foo (...)
{
  <return address of foo_{1,2,3}>
}

We can call foo in the same file. Gcc checks the return value for
foo.


-- 
           Summary: Add a new ifunc attribute
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40528


^ permalink raw reply	[flat|nested] 18+ messages in thread
[parent not found: <bug-40528-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-07-08  8:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23 17:17 [Bug c/40528] New: Add a new ifunc attribute hjl dot tools at gmail dot com
2009-06-24  9:39 ` [Bug c/40528] " rguenth at gcc dot gnu dot org
2009-06-24 15:28 ` hjl dot tools at gmail dot com
2009-06-24 15:31 ` hjl dot tools at gmail dot com
2009-06-24 15:54 ` jakub at gcc dot gnu dot org
2009-06-24 16:07 ` hjl dot tools at gmail dot com
2009-06-24 19:26 ` jakub at gcc dot gnu dot org
2009-06-24 19:32 ` hjl dot tools at gmail dot com
2009-06-25 14:12 ` hjl dot tools at gmail dot com
2009-06-26 16:14 ` hjl dot tools at gmail dot com
2009-06-26 20:20 ` hjl dot tools at gmail dot com
2009-06-26 20:39 ` hjl dot tools at gmail dot com
2009-06-26 20:41 ` hjl dot tools at gmail dot com
2009-06-28 15:14 ` hjl at gcc dot gnu dot org
2010-02-21 16:21 ` agner at agner dot org
2010-02-21 16:34 ` hjl dot tools at gmail dot com
     [not found] <bug-40528-4@http.gcc.gnu.org/bugzilla/>
2011-05-30 13:16 ` agner at agner dot org
2011-07-08  8:53 ` agner at agner dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).