diff options
author | Kai Tietz <ktietz@redhat.com> | 2012-03-07 10:35:15 +0100 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2012-03-07 10:35:15 +0100 |
commit | 98b1d9b2fa29f9d07a796a21e99dff060b8fac8d (patch) | |
tree | d05b512d4849fae49f07165f43623b14c98f46bb | |
parent | f409d239aeaa0f7f858163f678febc3603b107dd (diff) | |
download | gcc-98b1d9b2fa29f9d07a796a21e99dff060b8fac8d.zip gcc-98b1d9b2fa29f9d07a796a21e99dff060b8fac8d.tar.gz gcc-98b1d9b2fa29f9d07a796a21e99dff060b8fac8d.tar.bz2 |
invoke.texi (fwritable-relocated-rdata): Document new Cygwin/MinGW target option.
* doc/invoke.texi (fwritable-relocated-rdata): Document
new Cygwin/MinGW target option.
* config/i386/winnt.c (i386_pe_unique_section): Ignore
reloc if flag -fwritable-relocated-rdata is not set.
(i386_pe_section_type_flags): Likewise.
* config/i386/cygming.opt (fwritable-relocated-rdata):
Add new flag variable flag_writable_rel_rdata.
From-SVN: r185027
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/i386/cygming.opt | 4 | ||||
-rw-r--r-- | gcc/config/i386/winnt.c | 8 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 7 |
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c98c983..b38b16d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2012-03-07 Kai Tietz <ktietz@redhat.com> + + * doc/invoke.texi (fwritable-relocated-rdata): Document + new Cygwin/MinGW target option. + * config/i386/winnt.c (i386_pe_unique_section): Ignore + reloc if flag -fwritable-relocated-rdata is not set. + (i386_pe_section_type_flags): Likewise. + * config/i386/cygming.opt (fwritable-relocated-rdata): + Add new flag variable flag_writable_rel_rdata. + 2012-03-07 Richard Guenther <rguenther@suse.de> * tree-ssa-math-opts.c (convert_mult_to_widen): Check actual diff --git a/gcc/config/i386/cygming.opt b/gcc/config/i386/cygming.opt index 2d23523..bcee9d4 100644 --- a/gcc/config/i386/cygming.opt +++ b/gcc/config/i386/cygming.opt @@ -53,4 +53,8 @@ Compile code that relies on Cygwin DLL wrappers to support C++ operator new/dele posix Driver +fwritable-relocated-rdata +Common Report Var(flag_writable_rel_rdata) Init(0) +Put relocated read-only data into .data section. + ; Retain blank line above diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index 79cbb6b..c1ed1c0 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -395,6 +395,10 @@ i386_pe_unique_section (tree decl, int reloc) const char *name, *prefix; char *string; + /* Ignore RELOC, if we are allowed to put relocated + const data into read-only section. */ + if (!flag_writable_rel_rdata) + reloc = 0; name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); name = i386_pe_strip_name_encoding_full (name); @@ -441,6 +445,10 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc) unsigned int flags; unsigned int **slot; + /* Ignore RELOC, if we are allowed to put relocated + const data into read-only section. */ + if (!flag_writable_rel_rdata) + reloc = 0; /* The names we put in the hashtable will always be the unique versions given to us by the stringtable, so we can just use their addresses as the keys. */ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index d10156b..969fcbe 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -14014,6 +14014,13 @@ set. This is necessary for binaries running in kernel mode of Microsoft Windows, as there the User32 API, which is used to set executable privileges, isn't available. +@item -fwritable-relocated-rdata +@opindex fno-writable-relocated-rdata +This option is available for MinGW and Cygwin targets. It specifies +that relocated-data in read-only section is put into .data +section. This is a necessary for older runtimes not supporting +modification of .rdata sections for pseudo-relocation. + @item -mpe-aligned-commons @opindex mpe-aligned-commons This option is available for Cygwin and MinGW targets. It |