This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc-20000114 ix86 -fdata-sections


Hi Alan,

: Did you see http://gcc.gnu.org/ml/gcc-bugs/2000-01/msg00437.html ?

  Thanks for drawing my attention to this bug.  I had not noticed it
  before.  I agree with your analysis of the bug and also with your
  patch to solve it.  The only thing missing was the repetition of the
  patch in a couple of target specific back ends.

  Unless there any objections, I will check in the patch below to fix
  this problem.

Cheers
	Nick

2000-01-21  Alan Modra <alan@SPRI.Levels.UniSA.Edu.Au>

        * config/elfos.h (UNIQUE_SECTION): Restore uninitialised data
        section naming to that prior to 2000-01-07 patch.
	* config/mips/elf.h (UNIQUE_SECTION): Ditto.
	* config/mips/elf64.h (UNIQUE_SECTION): Ditto.
	* config/mips/iris6gld.h (UNIQUE_SECTION): Ditto.
	* config/i386/interix.c (UNIQUE_SECTION): Ditto.
	* config/i386/winnt.c (UNIQUE_SECTION): Ditto.

Index: config/elfos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/elfos.h,v
retrieving revision 1.13
diff -p -r1.13 elfos.h
*** elfos.h	2000/01/10 23:48:02	1.13
--- elfos.h	2000/01/21 23:21:44
*************** dtors_section ()						\
*** 359,381 ****
        const char *name;						\
        char *string;						\
        const char *prefix;					\
!       static const char *prefixes[4][2] =			\
        {								\
  	{ ".text.",   ".gnu.linkonce.t." },			\
  	{ ".rodata.", ".gnu.linkonce.r." },			\
! 	{ ".data.",   ".gnu.linkonce.d." },			\
  	/* Do not generate unique sections for uninitialised 	\
  	   data since we do not have support for this in the    \
  	   linker scripts yet...				\
!         { ".bss.",    ".gnu.linkonce.b." }  */			\
! 	{ "", "" }						\
        };							\
        								\
        if (TREE_CODE (DECL) == FUNCTION_DECL)			\
  	sec = 0;						\
        else if (DECL_INITIAL (DECL) == 0				\
  	       || DECL_INITIAL (DECL) == error_mark_node)	\
! 	sec = 3;						\
        else if (DECL_READONLY_SECTION (DECL, RELOC))		\
  	sec = 1;						\
        else							\
--- 359,380 ----
        const char *name;						\
        char *string;						\
        const char *prefix;					\
!       static const char *prefixes[/*4*/3][2] =			\
        {								\
  	{ ".text.",   ".gnu.linkonce.t." },			\
  	{ ".rodata.", ".gnu.linkonce.r." },			\
! 	{ ".data.",   ".gnu.linkonce.d." }			\
  	/* Do not generate unique sections for uninitialised 	\
  	   data since we do not have support for this in the    \
  	   linker scripts yet...				\
!         ,{ ".bss.",    ".gnu.linkonce.b." }  */			\
        };							\
        								\
        if (TREE_CODE (DECL) == FUNCTION_DECL)			\
  	sec = 0;						\
        else if (DECL_INITIAL (DECL) == 0				\
  	       || DECL_INITIAL (DECL) == error_mark_node)	\
!         sec = /* 3 */ 2;					\
        else if (DECL_READONLY_SECTION (DECL, RELOC))		\
  	sec = 1;						\
        else							\

Index: config/i386/interix.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/interix.c,v
retrieving revision 1.3
diff -p -r1.3 interix.c
*** interix.c	2000/01/05 23:26:06	1.3
--- interix.c	2000/01/21 23:21:45
*************** i386_pe_unique_section (decl, reloc)
*** 95,101 ****
      prefix = ".text$";
    else if (DECL_INITIAL (decl) == 0
  	   || DECL_INITIAL (decl) == error_mark_node)
!     prefix = "";
    else if (DECL_READONLY_SECTION (decl, reloc))
  #ifdef READONLY_DATA_SECTION
      prefix = ".rdata$";
--- 95,101 ----
      prefix = ".text$";
    else if (DECL_INITIAL (decl) == 0
  	   || DECL_INITIAL (decl) == error_mark_node)
!     prefix = ".data";
    else if (DECL_READONLY_SECTION (decl, reloc))
  #ifdef READONLY_DATA_SECTION
      prefix = ".rdata$";

Index: config/i386/winnt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/winnt.c,v
retrieving revision 1.17
diff -p -r1.17 winnt.c
*** winnt.c	2000/01/05 23:26:06	1.17
--- winnt.c	2000/01/21 23:21:45
*************** i386_pe_unique_section (decl, reloc)
*** 482,488 ****
      prefix = ".text$";
    else if (DECL_INITIAL (decl) == 0
  	   || DECL_INITIAL (decl) == error_mark_node)
!     prefix = "";
    else if (DECL_READONLY_SECTION (decl, reloc))
  #ifdef READONLY_DATA_SECTION
      prefix = ".rdata$";
--- 482,488 ----
      prefix = ".text$";
    else if (DECL_INITIAL (decl) == 0
  	   || DECL_INITIAL (decl) == error_mark_node)
!     prefix = ".data";
    else if (DECL_READONLY_SECTION (decl, reloc))
  #ifdef READONLY_DATA_SECTION
      prefix = ".rdata$";

Index: config/mips/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/elf.h,v
retrieving revision 1.16
diff -p -r1.16 elf.h
*** elf.h	2000/01/05 23:26:06	1.16
--- elf.h	2000/01/21 23:21:46
*************** do {									 \
*** 212,223 ****
  do {									   \
    int len, size, sec;							   \
    char *name, *string, *prefix;						   \
!   static char *prefixes[5][2] = {					   \
      { ".text.", ".gnu.linkonce.t." },					   \
      { ".rodata.", ".gnu.linkonce.r." },					   \
      { ".data.", ".gnu.linkonce.d." },					   \
!     { ".sdata.", ".gnu.linkonce.s." },					   \
!     { "", "" }								   \
    };									   \
  									   \
    name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));		   \
--- 212,222 ----
  do {									   \
    int len, size, sec;							   \
    char *name, *string, *prefix;						   \
!   static char *prefixes[4][2] = {					   \
      { ".text.", ".gnu.linkonce.t." },					   \
      { ".rodata.", ".gnu.linkonce.r." },					   \
      { ".data.", ".gnu.linkonce.d." },					   \
!     { ".sdata.", ".gnu.linkonce.s." }					   \
    };									   \
  									   \
    name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));		   \
*************** do {									   \
*** 229,235 ****
      sec = 0;								   \
    else if (DECL_INITIAL (DECL) == 0					   \
             || DECL_INITIAL (DECL) == error_mark_node)			   \
!     sec = 4;								   \
    else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16)			   \
        && TREE_CODE (decl) == STRING_CST					   \
        && !flag_writable_strings)					   \
--- 228,234 ----
      sec = 0;								   \
    else if (DECL_INITIAL (DECL) == 0					   \
             || DECL_INITIAL (DECL) == error_mark_node)			   \
!     sec = 2;								   \
    else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16)			   \
        && TREE_CODE (decl) == STRING_CST					   \
        && !flag_writable_strings)					   \

Index: config/mips/elf64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/elf64.h,v
retrieving revision 1.19
diff -p -r1.19 elf64.h
*** elf64.h	2000/01/05 23:31:29	1.19
--- elf64.h	2000/01/21 23:21:46
*************** do {									 \
*** 193,204 ****
  do {									   \
    int len, size, sec;							   \
    char *name, *string, *prefix;						   \
!   static char *prefixes[5][2] = {					   \
      { ".text.", ".gnu.linkonce.t." },					   \
      { ".rodata.", ".gnu.linkonce.r." },					   \
      { ".data.", ".gnu.linkonce.d." },					   \
!     { ".sdata.", ".gnu.linkonce.s." },					   \
!     { "", "" }								   \
    };									   \
  									   \
    name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));		   \
--- 193,203 ----
  do {									   \
    int len, size, sec;							   \
    char *name, *string, *prefix;						   \
!   static char *prefixes[4][2] = {					   \
      { ".text.", ".gnu.linkonce.t." },					   \
      { ".rodata.", ".gnu.linkonce.r." },					   \
      { ".data.", ".gnu.linkonce.d." },					   \
!     { ".sdata.", ".gnu.linkonce.s." }					   \
    };									   \
  									   \
    name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL));		   \
*************** do {									   \
*** 210,216 ****
      sec = 0;								   \
    else if (DECL_INITIAL (DECL) == 0					   \
             || DECL_INITIAL (DECL) == error_mark_node)			   \
!     sec = 4;								   \
    else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16)			   \
        && TREE_CODE (decl) == STRING_CST					   \
        && !flag_writable_strings)					   \
--- 209,215 ----
      sec = 0;								   \
    else if (DECL_INITIAL (DECL) == 0					   \
             || DECL_INITIAL (DECL) == error_mark_node)			   \
!     sec = 2;								   \
    else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16)			   \
        && TREE_CODE (decl) == STRING_CST					   \
        && !flag_writable_strings)					   \

Index: config/mips/iris6gld.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/mips/iris6gld.h,v
retrieving revision 1.6
diff -p -r1.6 iris6gld.h
*** iris6gld.h	2000/01/05 23:26:06	1.6
--- iris6gld.h	2000/01/21 23:21:46
*************** Boston, MA 02111-1307, USA.  */
*** 59,81 ****
        char *name;						\
        char *string;						\
        char *prefix;						\
!       static char *prefixes[4][2] =				\
        {								\
  	{ ".text.",   ".gnu.linkonce.t." },			\
  	{ ".rodata.", ".gnu.linkonce.r." },			\
! 	{ ".data.",   ".gnu.linkonce.d." },			\
  	/* Do not generate unique sections for uninitialised 	\
  	   data since we do not have support for this in the    \
  	   linker scripts yet...				\
!         { ".bss.",    ".gnu.linkonce.b." }  */			\
! 	{ "", "" }						\
        };							\
        								\
        if (TREE_CODE (DECL) == FUNCTION_DECL)			\
  	sec = 0;						\
        else if (DECL_INITIAL (DECL) == 0				\
  	       || DECL_INITIAL (DECL) == error_mark_node)	\
! 	sec = 3;						\
        else if (DECL_READONLY_SECTION (DECL, RELOC))		\
  	sec = 1;						\
        else							\
--- 59,80 ----
        char *name;						\
        char *string;						\
        char *prefix;						\
!       static char *prefixes[/*4*/3][2] =			\
        {								\
  	{ ".text.",   ".gnu.linkonce.t." },			\
  	{ ".rodata.", ".gnu.linkonce.r." },			\
! 	{ ".data.",   ".gnu.linkonce.d." }			\
  	/* Do not generate unique sections for uninitialised 	\
  	   data since we do not have support for this in the    \
  	   linker scripts yet...				\
!         , { ".bss.",    ".gnu.linkonce.b." }  */		\
        };							\
        								\
        if (TREE_CODE (DECL) == FUNCTION_DECL)			\
  	sec = 0;						\
        else if (DECL_INITIAL (DECL) == 0				\
  	       || DECL_INITIAL (DECL) == error_mark_node)	\
!         sec = /* 3 */ 2;					\
        else if (DECL_READONLY_SECTION (DECL, RELOC))		\
  	sec = 1;						\
        else							\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]