* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Error if
authorAlan Modra <amodra@gmail.com>
Mon, 9 Aug 2004 06:48:37 +0000 (06:48 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 9 Aug 2004 06:48:37 +0000 (06:48 +0000)
.toc is too large on relocatable linking.

ld/ChangeLog
ld/emultempl/ppc64elf.em

index f1f45d8c1ddc13cbdbc5d642f1bb0d0053603526..658ea4afb064239705068306e6ab9f45600be793 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-09  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Error if
+       .toc is too large on relocatable linking.
+
 2004-08-09  Alan Modra  <amodra@bigpond.net.au>
 
        * emultempl/ppc64elf.em (ppc_after_open): Delete.
index 3ddf941bbd28654e23257e24a53b4b1ca26e5ac1..ffd6a2bcf08be72ea774b0dcc13c0ae07ec175ef 100644 (file)
@@ -352,6 +352,14 @@ gld${EMULATION_NAME}_finish (void)
   if (need_laying_out)
     ppc_layout_sections_again ();
 
+  if (link_info.relocatable)
+    {
+      asection *toc = bfd_get_section_by_name (output_bfd, ".toc");
+      if (toc != NULL
+         && bfd_section_size (output_bfd, toc) > 0x10000)
+       einfo ("%X%P: TOC section size exceeds 64k\n");
+    }
+
   if (stub_added)
     {
       char *msg = NULL;