This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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 Fri, Jun 26, 2009 at 3:10 PM, Roland McGrath<roland@redhat.com> wrote:
>> along with its static Linux/ia32 binary. How do you
>> write a similar prog.C in C++ with your ifunc attribute
>> proposal?
>
> The only difference is using (Class::*) vs (*) in the return type of the
> foo_finder functions. ?Did I missing something obvious?
>
>

The one problem with using asm () for C++ name mangling is
it isn't easy to figure out what the assembly symbol one is.
If you change the function prototype, you have to figure
out the assembly name again.

with

class Foo
{
private:
  virtual void foo1 ()
    {
      printf ("I am %s\n", __PRETTY_FUNCTION__);
    }
public:
  virtual void  __attribute__ ((ifunc)) foo ()
    {
      return &Foo::foo1;
    }
};

there is no such problem.

-- 
H.J.


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