This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: always allow for pe-coff that relocations can be put into readonly memory
- From: Richard Henderson <rth at redhat dot com>
- To: Kai Tietz <ktietz70 at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 27 Jun 2012 13:13:03 -0700
- Subject: Re: [patch i386]: always allow for pe-coff that relocations can be put into readonly memory
- References: <CAEwic4ZT4MGh4qvo5ycSsz-3dt43irqVP6F7QQYBW1fEOx+-Kg@mail.gmail.com>
On 06/27/2012 12:47 PM, Kai Tietz wrote:
> 2012-06-27 Kai Tietz
>
> * config/i386/winnt.c (i386_pe_reloc_rw_mask): New function.
> * config/i386/i386-protos.h (i386_pe_reloc_rw_mask): Add
> prototype.
> * config/i386/cygming.h (TARGET_ASM_RELOC_RW_MASK): Define
> as i386_pe_reloc_rw_mask.
>
> Tested for i686-pc-cygwin, i686-w64-mingw32, and x86_64-w64-mingw32.
> Ok for apply?
Plausible.
I suppose this gets handled by the windows loader similar to how
the .data.ro sections get handled by an elf loader with -z relro?
I.e. relocations applied then the page protections reapplied?
Would it be of any use to introduce an .rdata$N section (equivalent
to .data.ro) so that most of the runtime relocations are adjacent,
and more of the executable image is sharable?
r~