In message "Re: [Mingw-users] static const storage and runtime-pseudo-reloc",
Brian Dessent wrote...
>Takashi Ono wrote:
>> Thank you so much , Danny. I will try it. It may fix many problems. Why don't
>> include it in MinGW distributions? Suspucious copyright?
>Uh... the solution in that link is a total hack, it just puts everything
>in the writable .data segment without regard for whether it's constant.
>It would be really silly to make all users of MinGW pay the severe price
>of losing .rdata just because of a few corner cases, which can usually
>be fixed by removing a "const" from a declaration somewhere.
I do not think they are just a few corner cases. The cases do occur in xmlsec and
a couple modules in OOo.
It is not good for platforms other than MinGW to remove const specifier, so I have
to use #ifdef __MINGW32__ - #else - #endif and include both the statements
"const" removed and original. It is unpleasant for me, although I am really doing
so for the time being. Some problematic constant specifiers are in typedefs in
xmlsec library and the patched code does not seem very clean.
But I agree with you that placing every constant storage in writable segment and I
do not take the suggested workaround. The storage should be placed in writable
memory if and only if it includes relocatable references that should be resolved
after loading. I wounder if somebody is working for any better solution ...
Takashi Ono(HK Freak)
mailto:t_ono@... or MHF00056@...
(Personal Address, checked every morning/evening and holidays)
(Address for business, checked every working days)