patch: win32 linker bug workaround for .rdata$* section

Mumit Khan khan@xraylith.wisc.edu
Thu Feb 19 14:24:00 GMT 1998


Using just .rdata$* (grouped) sections in the C++ front-end tweaks a
linker bug, so I suggest disabling it for now (GCC currently doesn't 
use .rdata, rather puts read-only data in the .text section). When GCC 
starts using .rdata section, and hence defines READONLY_DATA_SECTION, 
this will then turn on as well.

Thu Feb 19 16:01:46 1998  Mumit Khan <khan@xraylith.wisc.edu>

	* config/i386/winnt.c (i386_pe_unique_section): Don't use .rdata
	section unless READONLY_DATA_SECTION is already defined. Currently
	using .rdata$* grouped sections tweaks a linker bug.

Index: gcc/config/i386/winnt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/winnt.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 winnt.c
--- winnt.c	1997/11/02 08:42:43	1.1.1.2
+++ winnt.c	1998/02/19 22:03:18
@@ -82,7 +82,11 @@ i386_pe_unique_section (decl, reloc)
   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);


Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/



More information about the Gcc-bugs mailing list