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 to bring java vtables closer to g++ abi conformance


On Sat, Jan 26, 2002 at 11:56:19AM +1300, Bryce McKinlay wrote:
> Daniel Jacobowitz wrote:
> 
> >As far as this goes, do whatever you want - but put the symbol name for
> >the vtable where it would be if this were a C++ class. 
> >
> Assuming pre-generated (rather than runtime) vtables, wont the symbol 
> will always point to the real start of the vtable? In C++ I believe the 
> two-words-at-negative-offset thing only applies to single inheritance. 
> There could be more data at a negative offset with a more complex class 
> heirarchy.

No, the symbol with the appropriate mangled name points wherever you
put it.  Separate non-abstract classes in C++ have their own vtable,
regardless of inheritance relationships, because of how dynamic_cast<>
works.

That's my understanding anyway.

> For binary compatibility, there isn't a symbol for the vtable at all 
> because the vtable isn't laid out until runtime.

Then we will need to come up with a solution for this eventually. 
Probably one involving RTTI.  I still don't understand why runtime
vtable's are really necessary, but I don't know anything about the GCJ
runtime at all.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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