This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PPC64: warn on large .toc


The linker is going to complain if a TOC section is too large, but it's
nice to get a warning a little earlier.

	* config/tc-ppc.c (ppc_frob_file_before_adjust): Warn if .toc too big.
	(ppc_arch): Expand comment.

Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.90
diff -u -p -r1.90 tc-ppc.c
--- gas/config/tc-ppc.c	27 Jul 2004 11:37:08 -0000	1.90
+++ gas/config/tc-ppc.c	27 Jul 2004 13:53:02 -0000
@@ -1156,7 +1156,8 @@ ppc_set_cpu ()
     }
 }
 
-/* Figure out the BFD architecture to use.  */
+/* Figure out the BFD architecture to use.  This function and ppc_mach
+   are called well before md_begin, when the output file is opened.  */
 
 enum bfd_architecture
 ppc_arch ()
@@ -1891,6 +1892,7 @@ void
 ppc_frob_file_before_adjust ()
 {
   symbolS *symp;
+  asection *toc;
 
   if (!ppc_obj64)
     return;
@@ -1922,6 +1924,11 @@ ppc_frob_file_before_adjust ()
 
     }
 
+  toc = bfd_get_section_by_name (stdoutput, ".toc");
+  if (toc != NULL
+      && bfd_section_size (stdoutput, toc) > 0x10000)
+    as_warn (_("TOC section size exceeds 64k"));
+
   /* Don't emit .TOC. symbol.  */
   symp = symbol_find (".TOC.");
   if (symp != NULL)

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]