25c7f1
2016-05-04  Alan Modra  <amodra@gmail.com>
25c7f1
25c7f1
	* config/rs6000/rs6000.c (rs6000_elf_output_toc_section_asm_op):
25c7f1
	Align .toc.
25c7f1
25c7f1
--- gcc/config/rs6000/rs6000.c
25c7f1
+++ gcc/config/rs6000/rs6000.c
25c7f1
@@ -31339,8 +31339,8 @@ rs6000_elf_output_toc_section_asm_op (const void *data ATTRIBUTE_UNUSED)
25c7f1
     {
25c7f1
       if (!toc_initialized)
25c7f1
 	{
25c7f1
-	  toc_initialized = 1;
25c7f1
 	  fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);
25c7f1
+	  ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2);
25c7f1
 	  (*targetm.asm_out.internal_label) (asm_out_file, "LCTOC", 0);
25c7f1
 	  fprintf (asm_out_file, "\t.tc ");
25c7f1
 	  ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1[TC],");
25c7f1
@@ -31348,20 +31348,30 @@ rs6000_elf_output_toc_section_asm_op (const void *data ATTRIBUTE_UNUSED)
25c7f1
 	  fprintf (asm_out_file, "\n");
25c7f1
 
25c7f1
 	  fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
25c7f1
+	  ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2);
25c7f1
 	  ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1");
25c7f1
 	  fprintf (asm_out_file, " = .+32768\n");
25c7f1
+	  toc_initialized = 1;
25c7f1
 	}
25c7f1
       else
25c7f1
 	fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
25c7f1
     }
25c7f1
   else if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2)
25c7f1
 	   && !TARGET_RELOCATABLE)
25c7f1
-    fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);
25c7f1
+    {
25c7f1
+      fprintf (asm_out_file, "%s\n", TOC_SECTION_ASM_OP);
25c7f1
+      if (!toc_initialized)
25c7f1
+	{
25c7f1
+	  ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2);
25c7f1
+	  toc_initialized = 1;
25c7f1
+	}
25c7f1
+    }
25c7f1
   else
25c7f1
     {
25c7f1
       fprintf (asm_out_file, "%s\n", MINIMAL_TOC_SECTION_ASM_OP);
25c7f1
       if (!toc_initialized)
25c7f1
 	{
25c7f1
+	  ASM_OUTPUT_ALIGN (asm_out_file, TARGET_64BIT ? 3 : 2);
25c7f1
 	  ASM_OUTPUT_INTERNAL_LABEL_PREFIX (asm_out_file, "LCTOC1");
25c7f1
 	  fprintf (asm_out_file, " = .+32768\n");
25c7f1
 	  toc_initialized = 1;