* top.h (lim_at_start): Declare.
[deliverable/binutils-gdb.git] / ld / ldmain.c
index 125dc6a9a79a01141ee3e218cdfa9ece11c08dc7..08a0ec4bc6b5a9ae25aab30da4a18e91c61ffb27 100644 (file)
@@ -155,7 +155,8 @@ static struct bfd_link_callbacks link_callbacks =
   reloc_overflow,
   reloc_dangerous,
   unattached_reloc,
-  notice
+  notice,
+  error_handler
 };
 
 struct bfd_link_info link_info;
@@ -290,6 +291,8 @@ main (argc, argv)
   link_info.emitrelocations = FALSE;
   link_info.task_link = FALSE;
   link_info.shared = FALSE;
+  link_info.pie = FALSE;
+  link_info.executable = FALSE;
   link_info.symbolic = FALSE;
   link_info.export_dynamic = FALSE;
   link_info.static_link = FALSE;
@@ -328,6 +331,7 @@ main (argc, argv)
   link_info.spare_dynamic_tags = 5;
   link_info.flags = (bfd_vma) 0;
   link_info.flags_1 = (bfd_vma) 0;
+  link_info.relax_finalizing = FALSE;
 
   ldfile_add_arch ("");
 
@@ -366,6 +370,9 @@ main (argc, argv)
        einfo (_("%P%F: -f may not be used without -shared\n"));
     }
 
+  if (! link_info.shared || link_info.pie)
+    link_info.executable = TRUE;
+
   /* Treat ld -r -s as ld -r -S -x (i.e., strip all local symbols).  I
      don't see how else this can be handled, since in this case we
      must preserve all externally visible symbols.  */
@@ -1360,6 +1367,15 @@ undefined_symbol (info, name, abfd, section, address, fatal)
   return TRUE;
 }
 
+/* Counter to limit the number of relocation overflow error messages
+   to print.  Errors are printed as it is decremented.  When it's
+   called and the counter is zero, a final message is printed
+   indicating more relocations were omitted.  When it gets to -1, no
+   such errors are printed.  If it's initially set to a value less
+   than -1, all such errors will be printed (--verbose does this).  */
+
+int overflow_cutoff_limit = 10;
+
 /* This is called when a reloc overflows.  */
 
 static bfd_boolean
@@ -1372,10 +1388,21 @@ reloc_overflow (info, name, reloc_name, addend, abfd, section, address)
      asection *section;
      bfd_vma address;
 {
+  if (overflow_cutoff_limit == -1)
+    return TRUE;
+
   if (abfd == (bfd *) NULL)
     einfo (_("%P%X: generated"));
   else
     einfo ("%X%C:", abfd, section, address);
+
+  if (overflow_cutoff_limit >= 0
+      && overflow_cutoff_limit-- == 0)
+    {
+      einfo (_(" additional relocation overflows omitted from the output\n"));
+      return TRUE;
+    }
+
   einfo (_(" relocation truncated to fit: %s %T"), reloc_name, name);
   if (addend != 0)
     einfo ("+%v", addend);
This page took 0.07496 seconds and 4 git commands to generate.