Make more of the OLE interface vtables const

Marcus Meissner marcus at jet.franken.de
Mon May 30 00:02:19 CDT 2005


On Mon, May 30, 2005 at 11:33:28AM +0900, Dmitry Timoshkov wrote:
> "Andreas Mohr" <andi at rhlx01.fht-esslingen.de> wrote:
> 
> > On Sun, May 29, 2005 at 07:05:49PM +0900, Dmitry Timoshkov wrote:
> > > Hello,
> > > 
> > > Changelog:
> > >     Dmitry Timoshkov <dmitry at codeweavers.com>
> > >     Make more of the OLE interface vtables const.
> > You do know that those will *not* end up const?
> > 
> > filemoniker.c:static const IClassFactoryVtbl FileMonikerCFVtbl =
> > objdump -x ole32.dll.so:
> > 0008efb0 l     O .data  00000014              FileMonikerCFVtbl
> > 
> > My suspicion is that this is due to winegcc compile, all other binaries
> > with normal compile (e.g. winedump, ...) have all their const data in .rodata segment...
> > 
> > So, does anybody know what seems to be wrong with winegcc or why it chose to do that?
> 
> It appears to be not a winegcc problem. That's how gcc generates pointer tables
> (regardless of the pointer type). Although it (gcc) correctly produces warnings
> about losing 'const' attribute while passing a pointer to a const table around, it
> still places contents of the table into r/w section. I'd call it a gcc limitation,
> if not a bug.

The problem is that the pointers in the table need relocation, so it needs to
be modified during linking, so it cannot be fully const.

Ciao, Marcus



More information about the wine-devel mailing list