* config/tc-ppc.c (toc_reloc_types): New variable.
[deliverable/binutils-gdb.git] / gas / config / tc-ppc.c
index d36bbc969461a89c1c384f21098e08823bef2c8a..f054756c042656923f018b41f57606c555e70a9d 100644 (file)
@@ -183,6 +183,12 @@ int ppc_cie_data_alignment;
 /* The type of processor we are assembling for.  This is one or more
    of the PPC_OPCODE flags defined in opcode/ppc.h.  */
 ppc_cpu_t ppc_cpu = 0;
+
+/* Flags set on encountering toc relocs.  */
+enum {
+  has_large_toc_reloc = 1,
+  has_small_toc_reloc = 2
+} toc_reloc_types;
 \f
 /* The target specific pseudo-ops which we support.  */
 
@@ -2168,6 +2174,7 @@ ppc_frob_file_before_adjust (void)
 
   toc = bfd_get_section_by_name (stdoutput, ".toc");
   if (toc != NULL
+      && toc_reloc_types != has_large_toc_reloc
       && bfd_section_size (stdoutput, toc) > 0x10000)
     as_warn (_("TOC section size exceeds 64k"));
 
@@ -2783,6 +2790,20 @@ md_assemble (char *str)
                    }
                }
 
+             switch (reloc)
+               {
+               case BFD_RELOC_PPC_TOC16:
+                 toc_reloc_types |= has_small_toc_reloc;
+                 break;
+               case BFD_RELOC_PPC64_TOC16_LO:
+               case BFD_RELOC_PPC64_TOC16_HI:
+               case BFD_RELOC_PPC64_TOC16_HA:
+                 toc_reloc_types |= has_large_toc_reloc;
+                 break;
+               default:
+                 break;
+               }
+
              if (ppc_obj64
                  && (operand->flags & (PPC_OPERAND_DS | PPC_OPERAND_DQ)) != 0)
                {
This page took 0.027134 seconds and 4 git commands to generate.