----- Original Message -----
From: "Earnie Boyd"
> Danny Smith wrote:
> > GCC 3.4 stage 2 closes in about 11 days.
> >
> -8<-
>
> >
> > One place where it would have an advantage is when linking to dll's
> > without an import lib. Having data constants in rdata rather than
text
> > makes it easy to tell if a symbol is a function or variable.
> >
> -8<-
>
> >
> > Do we (mingw and cygwin - I assume Chris is listening) want this for
> > gcc-3.4? Or should I wait for 3.5 to submit patch.
> >
>
> I think you stated advantage would be worth having for 3.4.
>
Checked in to 3.4.
2003-10-07 Danny Smith <dannysmith@...>
* 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.
Index: config/i386/cygming.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/cygming.h,v
retrieving revision 1.7
diff -c -3 -p -r1.7 cygming.h
*** config/i386/cygming.h 30 Sep 2003 21:28:09 -0000 1.7
--- config/i386/cygming.h 6 Oct 2003 22:11:46 -0000
*************** drectve_section (void) \
*** 132,137 ****
--- 132,141 ----
}
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.
*************** switch_to_section (enum in_section secti
*** 147,152 ****
--- 151,157 ----
{ \
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; \
Index: config/i386/winnt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/winnt.c,v
retrieving revision 1.57
diff -c -3 -p -r1.57 winnt.c
*** config/i386/winnt.c 30 Sep 2003 21:28:09 -0000 1.57
--- config/i386/winnt.c 6 Oct 2003 22:11:48 -0000
*************** i386_pe_asm_named_section (const char *n
*** 710,721 ****
{
char flagchars[8], *f = flagchars;
! 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);
--- 710,731 ----
{
char flagchars[8], *f = flagchars;
! 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);
Danny
> Earnie.
> --
> http://www.mingw.org
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> MinGW-dvlpr mailing list
> MinGW-dvlpr@...
> https://lists.sourceforge.net/lists/listinfo/mingw-dvlpr
|