This is the mail archive of the gcc@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] | |
class A
{
virtual void Foo();
};Well, consider that if I were to build up a struct or array of function pointers from a class's constructor, I would be getting the real function address, not a PLT stub. This seems like the same thing conceptually as a vtable, and yet it would not have the PLT overhead.
Hmmm, I think I made an incorrect assumption here. What target are you talking about? The behaviour I see for a vtable on i686-pc-linux-gnu is the same as building an array of function pointers by hand. What actually happens depends upon whether you use -fpic when compiling and whether you link the vtable into a shared library.
-- -Brian Ryner bryner@brianryner.com
Attachment:
virtual-test.tar.gz
Description: application/gzip
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |