[cxx-abi-dev] Function descriptors in vtable

Mark Mitchell mark at codesourcery.com
Wed Jan 22 16:28:27 UTC 2003


> However, if the vtable was created by the C++ compiler, using it in C is
> still very hard.

That's correct.  Some compilers put the vtables in read-only data sections,
so it won't be easy to rewrite them.  Using a cooperative C++ compiler
would help; for example, if aCC had a "-com" switch that would cause it
to generate the format I suggested that would solve your problem.  (Such
a switch would leave it ABI-compatible.)

In theory, you could probably do something completely nasty involving
rewriting binaries; almost all vtables are external symbols whose names
start "_ZTV"; you could move them into writable memory.

-- 
Mark Mitchell                mark at codesourcery.com
CodeSourcery, LLC            http://www.codesourcery.com



More information about the cxx-abi-dev mailing list