Workaround for virtual function/dllimport bug, also patch guidance request

Mumit Khan khan@nanotech.wisc.edu
Thu Dec 16 15:17:00 GMT 1999


Jason Merrill <jason@cygnus.com> writes:
> I've checked this in:
> 
> 1999-12-14  Jason Merrill  <jason@casey.cygnus.com>
> 
> 	* decl2.c (import_export_class): Don't ignore dllimport.
> 

Jason,

This does the right thing, but exposes another problem in how we handle
this whole dllimport mess. After digging through the MSVC assembler, 
here's what happens for dllimported classes:
  
  - import vtable as needed (we know about this, and can do it now)
  - DO NOT import rtti info, but write it out. This is necessary to avoid
    having to take the address of tinfo node, and currently it's impossible 
    to do in gcc without writing out the vtable as well.

I don't know how to avoid writing vtables and still write out all the tinfo
nodes/functions; however, we should be able to create a new macro, say
CLASSTYPE_TINFO_NEEDS_WRITING, set that in import_export_class when
import_export = -2 (or import_export > 0, the usual case), and somehow
use that later on in finish_vtbls to just write out tinfo.

Is this doable? If so, this gets us pretty much what MSVC does, at least
from looking at the generated assembler.

Regards,
Mumit



More information about the Gcc mailing list