How to make vtable read only
807575Jun 11 2008 — edited Jun 13 2008Hi ,
I have a problem where our tests are panicing due to a corrupted
vtable. The corresponding object is always the same and the corruption
pattern is also the same. It is not reproducible on demand and the
complexity of the code makes it difficult to debug using usual methods.
I was wondering if there was someway to force the vtable of the
offending object to be readonly and thus catch the culprit in the
act. Some investigation makes me think it won't be as easy as
editing the elf section and moving the whole vtbl into .rodata. The
vtbl has to be written to once (?).
Is there any way this can be accomplished with compiler/linker flags
or directives?
cheers
Binu