Commit 7f27395d by Danny Smith Committed by Danny Smith

cygming.h (READONLY_DATA_SECTION_ASM_OP): Define.

	* config/i386/cygming.h (READONLY_DATA_SECTION_ASM_OP): Define.
	(switch_to_section): Handle in_readonly_data.
	* config/i386/winnt.c (i386_pe_asm_named_section): Handle
	readonly data.

From-SVN: r72189
parent f9b9980e
2003-10-07 Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/cygming.h (READONLY_DATA_SECTION_ASM_OP): Define.
(switch_to_section): Handle in_readonly_data.
* config/i386/winnt.c (i386_pe_asm_named_section): Handle
readonly data.
2003-10-07 Richard Earnshaw <rearnsha@arm.com>
* arm.md (cmpsi2_addneg): New ARM pattern. Add peephole2 to generate
......
......@@ -132,6 +132,10 @@ drectve_section (void) \
}
void drectve_section (void);
/* Older versions of gas don't handle 'r' as data.
Explicitly set data flag with 'd'. */
#define READONLY_DATA_SECTION_ASM_OP "\t.section .rdata,\"dr\""
/* Switch to SECTION (an `enum in_section').
??? This facility should be provided by GCC proper.
......@@ -147,6 +151,7 @@ switch_to_section (enum in_section section, tree decl) \
{ \
case in_text: text_section (); break; \
case in_data: data_section (); break; \
case in_readonly_data: readonly_data_section (); break; \
case in_named: named_section (decl, NULL, 0); break; \
case in_drectve: drectve_section (); break; \
default: abort (); break; \
......
......@@ -710,12 +710,22 @@ i386_pe_asm_named_section (const char *name, unsigned int flags)
{
char flagchars[8], *f = flagchars;
if (flags & SECTION_CODE)
*f++ = 'x';
if (flags & SECTION_WRITE)
*f++ = 'w';
if (flags & SECTION_PE_SHARED)
*f++ = 's';
if ((flags & (SECTION_CODE | SECTION_WRITE)) == 0)
/* readonly data */
{
*f++ ='d'; /* This is necessary for older versions of gas. */
*f++ ='r';
}
else
{
if (flags & SECTION_CODE)
*f++ = 'x';
if (flags & SECTION_WRITE)
*f++ = 'w';
if (flags & SECTION_PE_SHARED)
*f++ = 's';
}
*f = '\0';
fprintf (asm_out_file, "\t.section\t%s,\"%s\"\n", name, flagchars);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment