Commit e8c3586a by Alan Modra Committed by Nick Clifton

Fix definition of UNIQUE_SECTION so that zero initialised data is placed

into .data.

From-SVN: r31563
parent 37b80d2e
2000-01-22 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.
2000-01-22 Bernd Schmidt <bernds@cygnus.co.uk> 2000-01-22 Bernd Schmidt <bernds@cygnus.co.uk>
* config/arm/arm.c (soft_df_operand): Reject SUBREGs containing a * config/arm/arm.c (soft_df_operand): Reject SUBREGs containing a
......
...@@ -359,23 +359,22 @@ dtors_section () \ ...@@ -359,23 +359,22 @@ dtors_section () \
const char *name; \ const char *name; \
char *string; \ char *string; \
const char *prefix; \ const char *prefix; \
static const char *prefixes[4][2] = \ static const char *prefixes[/*4*/3][2] = \
{ \ { \
{ ".text.", ".gnu.linkonce.t." }, \ { ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \ { ".rodata.", ".gnu.linkonce.r." }, \
{ ".data.", ".gnu.linkonce.d." }, \ { ".data.", ".gnu.linkonce.d." } \
/* Do not generate unique sections for uninitialised \ /* Do not generate unique sections for uninitialised \
data since we do not have support for this in the \ data since we do not have support for this in the \
linker scripts yet... \ linker scripts yet... \
{ ".bss.", ".gnu.linkonce.b." } */ \ ,{ ".bss.", ".gnu.linkonce.b." } */ \
{ "", "" } \
}; \ }; \
\ \
if (TREE_CODE (DECL) == FUNCTION_DECL) \ if (TREE_CODE (DECL) == FUNCTION_DECL) \
sec = 0; \ sec = 0; \
else if (DECL_INITIAL (DECL) == 0 \ /* else if (DECL_INITIAL (DECL) == 0 \
|| DECL_INITIAL (DECL) == error_mark_node) \ || DECL_INITIAL (DECL) == error_mark_node) \
sec = 3; \ sec = 3; */ \
else if (DECL_READONLY_SECTION (DECL, RELOC)) \ else if (DECL_READONLY_SECTION (DECL, RELOC)) \
sec = 1; \ sec = 1; \
else \ else \
......
...@@ -93,9 +93,9 @@ i386_pe_unique_section (decl, reloc) ...@@ -93,9 +93,9 @@ i386_pe_unique_section (decl, reloc)
without a .rdata section. */ without a .rdata section. */
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
prefix = ".text$"; prefix = ".text$";
else if (DECL_INITIAL (decl) == 0 /* else if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node) || DECL_INITIAL (decl) == error_mark_node)
prefix = ""; prefix = ".bss"; */
else if (DECL_READONLY_SECTION (decl, reloc)) else if (DECL_READONLY_SECTION (decl, reloc))
#ifdef READONLY_DATA_SECTION #ifdef READONLY_DATA_SECTION
prefix = ".rdata$"; prefix = ".rdata$";
......
...@@ -480,9 +480,9 @@ i386_pe_unique_section (decl, reloc) ...@@ -480,9 +480,9 @@ i386_pe_unique_section (decl, reloc)
without a .rdata section. */ without a .rdata section. */
if (TREE_CODE (decl) == FUNCTION_DECL) if (TREE_CODE (decl) == FUNCTION_DECL)
prefix = ".text$"; prefix = ".text$";
else if (DECL_INITIAL (decl) == 0 /* else if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node) || DECL_INITIAL (decl) == error_mark_node)
prefix = ""; prefix = ".bss"; */
else if (DECL_READONLY_SECTION (decl, reloc)) else if (DECL_READONLY_SECTION (decl, reloc))
#ifdef READONLY_DATA_SECTION #ifdef READONLY_DATA_SECTION
prefix = ".rdata$"; prefix = ".rdata$";
......
...@@ -212,12 +212,11 @@ do { \ ...@@ -212,12 +212,11 @@ do { \
do { \ do { \
int len, size, sec; \ int len, size, sec; \
char *name, *string, *prefix; \ char *name, *string, *prefix; \
static char *prefixes[5][2] = { \ static char *prefixes[4][2] = { \
{ ".text.", ".gnu.linkonce.t." }, \ { ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \ { ".rodata.", ".gnu.linkonce.r." }, \
{ ".data.", ".gnu.linkonce.d." }, \ { ".data.", ".gnu.linkonce.d." }, \
{ ".sdata.", ".gnu.linkonce.s." }, \ { ".sdata.", ".gnu.linkonce.s." } \
{ "", "" } \
}; \ }; \
\ \
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
...@@ -229,7 +228,7 @@ do { \ ...@@ -229,7 +228,7 @@ do { \
sec = 0; \ sec = 0; \
else if (DECL_INITIAL (DECL) == 0 \ else if (DECL_INITIAL (DECL) == 0 \
|| DECL_INITIAL (DECL) == error_mark_node) \ || DECL_INITIAL (DECL) == error_mark_node) \
sec = 4; \ sec = 2; \
else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \ else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
&& TREE_CODE (decl) == STRING_CST \ && TREE_CODE (decl) == STRING_CST \
&& !flag_writable_strings) \ && !flag_writable_strings) \
......
...@@ -193,12 +193,11 @@ do { \ ...@@ -193,12 +193,11 @@ do { \
do { \ do { \
int len, size, sec; \ int len, size, sec; \
char *name, *string, *prefix; \ char *name, *string, *prefix; \
static char *prefixes[5][2] = { \ static char *prefixes[4][2] = { \
{ ".text.", ".gnu.linkonce.t." }, \ { ".text.", ".gnu.linkonce.t." }, \
{ ".rodata.", ".gnu.linkonce.r." }, \ { ".rodata.", ".gnu.linkonce.r." }, \
{ ".data.", ".gnu.linkonce.d." }, \ { ".data.", ".gnu.linkonce.d." }, \
{ ".sdata.", ".gnu.linkonce.s." }, \ { ".sdata.", ".gnu.linkonce.s." } \
{ "", "" } \
}; \ }; \
\ \
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (DECL)); \
...@@ -210,7 +209,7 @@ do { \ ...@@ -210,7 +209,7 @@ do { \
sec = 0; \ sec = 0; \
else if (DECL_INITIAL (DECL) == 0 \ else if (DECL_INITIAL (DECL) == 0 \
|| DECL_INITIAL (DECL) == error_mark_node) \ || DECL_INITIAL (DECL) == error_mark_node) \
sec = 4; \ sec = 2; \
else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \ else if ((TARGET_EMBEDDED_PIC || TARGET_MIPS16) \
&& TREE_CODE (decl) == STRING_CST \ && TREE_CODE (decl) == STRING_CST \
&& !flag_writable_strings) \ && !flag_writable_strings) \
......
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