summaryrefslogtreecommitdiffstats
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-18 21:49:55 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-18 21:49:55 +0000
commite8732146f7f279b1b54e131b5569669b56ded58a (patch)
treef12c29f73b3cb8794ea74aeb7771e9fe58367147 /gcc/varasm.c
parent13ea2c1f6cf133fb0ed47767787aabcb59919eb6 (diff)
downloadppe42-gcc-e8732146f7f279b1b54e131b5569669b56ded58a.tar.gz
ppe42-gcc-e8732146f7f279b1b54e131b5569669b56ded58a.zip
PR middle-end/15486
* varasm.c (asm_emit_uninitialised): Return early if a custom section is requested. (assemble_variable): Revert 2002-03-15 patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92365 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 078959f739e..e6d018c9125 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1442,9 +1442,16 @@ asm_emit_uninitialised (tree decl, const char *name,
destination = asm_dest_common;
}
+ if (destination != asm_dest_common)
+ {
+ resolve_unique_section (decl, 0, flag_data_sections);
+ /* Custom sections don't belong here. */
+ if (DECL_SECTION_NAME (decl))
+ return false;
+ }
+
if (destination == asm_dest_bss)
globalize_decl (decl);
- resolve_unique_section (decl, 0, flag_data_sections);
if (flag_shared_data)
{
@@ -1625,16 +1632,6 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (DECL_PRESERVE_P (decl))
targetm.asm_out.mark_decl_preserved (name);
- /* Output any data that we will need to use the address of. */
- if (DECL_INITIAL (decl) == error_mark_node)
- reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0;
- else if (DECL_INITIAL (decl))
- {
- reloc = compute_reloc_for_constant (DECL_INITIAL (decl));
- output_addressed_constants (DECL_INITIAL (decl));
- }
- resolve_unique_section (decl, reloc, flag_data_sections);
-
/* Handle uninitialized definitions. */
/* If the decl has been given an explicit section name, then it
@@ -1688,7 +1685,17 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (TREE_PUBLIC (decl) && DECL_NAME (decl))
globalize_decl (decl);
+ /* Output any data that we will need to use the address of. */
+ if (DECL_INITIAL (decl) == error_mark_node)
+ reloc = contains_pointers_p (TREE_TYPE (decl)) ? 3 : 0;
+ else if (DECL_INITIAL (decl))
+ {
+ reloc = compute_reloc_for_constant (DECL_INITIAL (decl));
+ output_addressed_constants (DECL_INITIAL (decl));
+ }
+
/* Switch to the appropriate section. */
+ resolve_unique_section (decl, reloc, flag_data_sections);
variable_section (decl, reloc);
/* dbxout.c needs to know this. */
OpenPOWER on IntegriCloud