Charles Wilson wrote: > The other question is, how is the ".rdata is read only, you can't change > anything there" enforced? By whom? Is this something about the pei-x86 > format that is enforced by the Windows Runtime Loader, or is it simply a > convention enforced by our startup objects (crt0.o etc)? If it's the > latter, then surely we can fix that ("Okay, it's read-only AFTER the > pseudo-reloc fixups are done").
Back before .rdata was enabled for user data in GCC, const data was put into ,text, which is normally readonly as well. But this, in pe-dll.c:pe_create_import_fixup line 2178 /* If we ever use autoimport, we have to cast text section writable. */ config.text_read_only = FALSE; output_bfd->flags &= ~WP_TEXT allowed it to work. . So checking one or both of these flags provides info on whether we might also need to make .rdata writeable. Me? I would just do something simple like mark the problematic data as dllimport. I don't like the idea of making .text writeable, let alone .rdata Danny -- > Chuck