aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-07-01 04:50:21 +0000
committerAlan Modra <amodra@gmail.com>2010-07-01 04:50:21 +0000
commit01efc3af7b9d3b0bfb9d1d8a748aad1102a810bc (patch)
tree990110115696cad7b41927e5b19315e0176315c9 /gas/config/tc-ppc.c
parentbddc25c9ca7f587e969e765cb73d904348ce9e00 (diff)
downloadgdb-01efc3af7b9d3b0bfb9d1d8a748aad1102a810bc.zip
gdb-01efc3af7b9d3b0bfb9d1d8a748aad1102a810bc.tar.gz
gdb-01efc3af7b9d3b0bfb9d1d8a748aad1102a810bc.tar.bz2
* config/tc-ppc.c (toc_reloc_types): New variable.
(md_assemble): Set it. (ppc_frob_file_before_adjust): Don't warn about toc section size if we have large toc relocs and no small toc relocs.
Diffstat (limited to 'gas/config/tc-ppc.c')
-rw-r--r--gas/config/tc-ppc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index d36bbc9..f054756 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -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;
/* 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)
{