diff options
author | Mumit Khan <khan@xraylith.wisc.edu> | 1998-03-01 16:55:15 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-03-01 09:55:15 -0700 |
commit | 81023100d3ae76c0a71d83247aa5b9d35732448f (patch) | |
tree | 5696e89a9ccd065d7df27c20be9bd6576b0154af /gcc | |
parent | 818e50a59da14950d7d0b0b687547c9124c1ccd0 (diff) | |
download | gcc-81023100d3ae76c0a71d83247aa5b9d35732448f.zip gcc-81023100d3ae76c0a71d83247aa5b9d35732448f.tar.gz gcc-81023100d3ae76c0a71d83247aa5b9d35732448f.tar.bz2 |
winnt.c (i386_pe_unique_section): Put read-only data in the text section unless READONLY_DATA_SECTION is defined.
* config/i386/winnt.c (i386_pe_unique_section): Put read-only
data in the text section unless READONLY_DATA_SECTION is defined.
From-SVN: r18342
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/winnt.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dddba35..8a261c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sun Mar 1 17:57:34 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * config/i386/winnt.c (i386_pe_unique_section): Put read-only + data in the text section unless READONLY_DATA_SECTION is defined. + Sun Mar 1 17:48:46 1998 Jeffrey A Law (law@cygnus.com) * c-parse.in (undeclared variable error): Tweak error message to diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index e8e5df3..8c35f39 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for Windows NT. Contributed by Douglas Rupp (drupp@cs.washington.edu) - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1997 Free Software Foundation, Inc. This file is part of GNU CC. @@ -19,8 +19,8 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdio.h> #include "config.h" +#include <stdio.h> #include "rtl.h" #include "regs.h" #include "hard-reg-set.h" @@ -78,11 +78,18 @@ i386_pe_unique_section (decl, reloc) /* The object is put in, for example, section .text$foo. The linker will then ultimately place them in .text - (everything from the $ on is stripped). */ + (everything from the $ on is stripped). Don't put + read-only data in .rdata section to avoid a PE linker + bug when .rdata$* grouped sections are used in code + without a .rdata section. */ if (TREE_CODE (decl) == FUNCTION_DECL) prefix = ".text$"; else if (DECL_READONLY_SECTION (decl, reloc)) +#ifdef READONLY_DATA_SECTION prefix = ".rdata$"; +#else + prefix = ".text$"; +#endif else prefix = ".data$"; len = strlen (name) + strlen (prefix); |