* emultempl/mmix-elfnmmo.em (mmix_after_allocation): Adjust
authorHans-Peter Nilsson <hp@axis.com>
Sat, 9 Feb 2002 05:07:07 +0000 (05:07 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Sat, 9 Feb 2002 05:07:07 +0000 (05:07 +0000)
register section vma to a sane value after emitting error.  Make
fatal conditions cause program exit when emitting message.

ld/ChangeLog
ld/emultempl/mmix-elfnmmo.em

index a6931b9..4362d52 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-09  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * emultempl/mmix-elfnmmo.em (mmix_after_allocation): Adjust
+       register section vma to a sane value after emitting error.  Make
+       fatal conditions cause program exit when emitting message.
+
 2002-02-08  Ivan Guzvinec <ivang@opencores.org>
 
        * configure.tgt: Add or32-*-rtems target.
index c6c7691..3357d36 100644 (file)
@@ -67,10 +67,16 @@ mmix_after_allocation ()
 
   regvma = 256 * 8 - sec->_raw_size - 8;
 
-  /* If we start on a local register, we have too many global registers.  */
+  /* If we start on a local register, we have too many global registers.
+     We treat this error as nonfatal (meaning processing will continue in
+     search for other errors), because it's a link error in the same way
+     as an undefined symbol.  */
   if (regvma < 32 * 8)
-    einfo ("%X%P: Too many global registers: %u, max 223\n",
-          (unsigned) sec->_raw_size / 8);
+    {
+      einfo ("%X%P: Too many global registers: %u, max 223\n",
+            (unsigned) sec->_raw_size / 8);
+      regvma = 32 * 8;
+    }
 
   /* Set vma to correspond to first such register number * 8.  */
   bfd_set_section_vma (output_bfd, sec, (bfd_vma) regvma);
@@ -80,9 +86,9 @@ mmix_after_allocation ()
   if (sec->_cooked_size == 0
       && ! bfd_set_section_size (output_bfd, sec, sec->_raw_size))
     {
-      einfo ("%X%P: Can't set section %s size to %u\n",
+      /* This is a fatal error; make the einfo call not return.  */
+      einfo ("%F%P: Can't set section %s size to %u\n",
             MMIX_REG_CONTENTS_SECTION_NAME, (unsigned) sec->_raw_size);
-      return;
     }
 
   /* Simplify symbol output for the register section (without contents;
@@ -94,9 +100,8 @@ mmix_after_allocation ()
 
   if (!_bfd_mmix_finalize_linker_allocated_gregs (output_bfd, &link_info))
     {
-      einfo ("%X%P: Can't finalize linker-allocated global registers\n");
-      /* In case stuff is added after this conditional.  */
-      return;
+      /* This is a fatal error; make einfo call not return.  */
+      einfo ("%F%P: Can't finalize linker-allocated global registers\n");
     }
 }
 EOF