Thu May 7 13:12:50 1998 Klaus Kaempf <kkaempf@progis.de>
[binutils-gdb.git] / bfd / coff-arm.c
index a64e0be06cc7f65377f4e5a8091770f7dc061594..9b924bbdafa0d5a98dea5823c246c550c4eea55c 100644 (file)
@@ -865,7 +865,7 @@ find_thumb_glue (info, name, input_bfd)
     (coff_hash_table (info), tmp_name, false, false, true);
   
   if (myh == NULL)
-    _bfd_error_handler ("%s: unable to find THUMB glue '%s' for `%s'",
+    _bfd_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"),
                        bfd_get_filename (input_bfd), tmp_name, name);
   
   free (tmp_name);
@@ -893,7 +893,7 @@ find_arm_glue (info, name, input_bfd)
     (coff_hash_table (info), tmp_name, false, false, true);
 
   if (myh == NULL)
-    _bfd_error_handler ("%s: unable to find ARM glue '%s' for `%s'",
+    _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"),
                        bfd_get_filename (input_bfd), tmp_name, name);
   
   free (tmp_name);
@@ -1146,10 +1146,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
                              && ! INTERWORK_FLAG (h_sec->owner))
                            {
                              _bfd_error_handler
-                               ("%s(%s): warning: interworking not enabled.",
+                               (_("%s(%s): warning: interworking not enabled."),
                                 bfd_get_filename (h_sec->owner), name);
                              _bfd_error_handler
-                               ("  first occurrence: %s: arm call to thumb",
+                               (_("  first occurrence: %s: arm call to thumb"),
                                 bfd_get_filename (input_bfd));
                            }
 
@@ -1233,10 +1233,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
                              && ! INTERWORK_FLAG (h_sec->owner))
                            {
                              _bfd_error_handler
-                               ("%s(%s): warning: interworking not enabled.",
+                               (_("%s(%s): warning: interworking not enabled."),
                                 bfd_get_filename (h_sec->owner), name);
                              _bfd_error_handler
-                               ("  first occurrence: %s: thumb call to arm",
+                               (_("  first occurrence: %s: thumb call to arm"),
                                 bfd_get_filename (input_bfd));
                            }
                          
@@ -1503,7 +1503,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
        case bfd_reloc_outofrange:
          (*_bfd_error_handler)
-           ("%s: bad reloc address 0x%lx in section `%s'",
+           (_("%s: bad reloc address 0x%lx in section `%s'"),
             bfd_get_filename (input_bfd),
             (unsigned long) rel->r_vaddr,
             bfd_get_section_name (input_bfd, input_section));
@@ -1951,7 +1951,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
          if (APCS_26_FLAG (obfd) != APCS_26_FLAG (ibfd))
            {
              _bfd_error_handler
-               ("%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d",
+               (_("%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d"),
                 bfd_get_filename (ibfd), APCS_26_FLAG (ibfd) ? 26 : 32,
                 bfd_get_filename (obfd), APCS_26_FLAG (obfd) ? 26 : 32
                 );
@@ -1962,11 +1962,14 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
          
          if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd))
            {
-             _bfd_error_handler
-               ("%s: ERROR: passes floats in %s registers whereas target %s uses %s registers",
-                bfd_get_filename (ibfd), APCS_FLOAT_FLAG (ibfd) ? "float" : "integer",
-                bfd_get_filename (obfd), APCS_FLOAT_FLAG (obfd) ? "float" : "integer"
-                );
+             const char *msg;
+
+             if (APCS_FLOAT_FLAG (ibfd))
+               msg = _("%s: ERROR: passes floats in float registers whereas target %s uses integer registers");
+             else
+               msg = _("%s: ERROR: passes floats in integer registers whereas target %s uses float registers");
+             _bfd_error_handler (msg, bfd_get_filename (ibfd),
+                                 bfd_get_filename (obfd));
 
              bfd_set_error (bfd_error_wrong_format);
              return false;
@@ -1974,11 +1977,14 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
          
          if (PIC_FLAG (obfd) != PIC_FLAG (ibfd))
            {
-             _bfd_error_handler
-               ("%s: ERROR: compiled as %s code, whereas target %s is %s",
-                bfd_get_filename (ibfd), PIC_FLAG (ibfd) ? "position independent" : "absoluste position",
-                bfd_get_filename (obfd), PIC_FLAG (obfd) ? "position independent" : "absoluste position"
-                );
+             const char *msg;
+
+             if (PIC_FLAG (ibfd))
+               msg = _("%s: ERROR: compiled as position independent code, whereas target %s is absolute position");
+             else
+               msg = _("%s: ERROR: compiled as absolute position code, whereas target %s is position independent");
+             _bfd_error_handler (msg, bfd_get_filename (ibfd),
+                                 bfd_get_filename (obfd));
 
              bfd_set_error (bfd_error_wrong_format);
              return false;
@@ -2001,13 +2007,14 @@ coff_arm_merge_private_bfd_data (ibfd, obfd)
          /* If the src and dest differ in their interworking issue a warning.  */
          if (INTERWORK_FLAG (obfd) != INTERWORK_FLAG (ibfd))
            {
-             _bfd_error_handler
-               ("Warning: input file %s %s interworking, whereas %s does%s",
-                bfd_get_filename (ibfd),
-                INTERWORK_FLAG (ibfd) ? "supports" : "does not support",
-                bfd_get_filename (obfd),
-                INTERWORK_FLAG (obfd) ? "." : " not."
-                );
+             const char *msg;
+
+             if (INTERWORK_FLAG (ibfd))
+               msg = _("Warning: input file %s supports internetworking, whereas %s does not.");
+             else
+               msg = _("Warning: input file %s does not support internetworking, whereas %s does.");
+             _bfd_error_handler (msg, bfd_get_filename (ibfd),
+                                 bfd_get_filename (obfd));
            }
        }
       else
@@ -2029,22 +2036,33 @@ coff_arm_print_private_bfd_data (abfd, ptr)
 {
   FILE * file = (FILE *) ptr;
   
-  BFD_ASSERT (abfd != NULL && ptr != NULL)
+  BFD_ASSERT (abfd != NULL && ptr != NULL);
   
-  fprintf (file, "private flags = %x", coff_data (abfd)->flags);
+  /* xgettext:c-format */
+  fprintf (file, _("private flags = %x:"), coff_data (abfd)->flags);
   
   if (APCS_SET (abfd))
-    fprintf (file, ": [APCS-%d] [floats passed in %s registers] [%s]",
-            APCS_26_FLAG (abfd) ? 26 : 32,
-            APCS_FLOAT_FLAG (abfd) ? "float" : "integer",
-            PIC_FLAG (abfd) ? "position independent" : "absolute position"
-            );
+    {
+      /* xgettext: APCS is ARM Prodecure Call Standard, it should not be translated.  */
+      fprintf (file, " [APCS-%d]", APCS_26_FLAG (abfd) ? 26 : 32);
+
+      if (APCS_FLOAT_FLAG (abfd))
+       fprintf (file, _(" [floats passed in float registers]"));
+      else
+       fprintf (file, _(" [floats passed in integer registers]"));
+
+      if (PIC_FLAG (abfd))
+       fprintf (file, _(" [position independent]"));
+      else
+       fprintf (file, _(" [absolute position]"));
+    }
   
-  if (INTERWORK_SET (abfd))
-    fprintf (file, " [interworking %ssupported]",
-            INTERWORK_FLAG (abfd) ? "" : "not " );
+  if (! INTERWORK_SET (abfd))
+    fprintf (file, _(" [interworking flag not initialised]"));
+  else if (INTERWORK_FLAG (abfd))
+    fprintf (file, _(" [interworking supported]"));
   else
-    fprintf (file, " [interworking flag not initialised]");
+    fprintf (file, _(" [interworking not supported]"));
   
   fputc ('\n', file);
   
@@ -2070,7 +2088,8 @@ _bfd_coff_arm_set_private_flags (abfd, flags)
 
   flag = (flags & F_APCS26) ? F_APCS_26 : 0;
   
-  /* Make sure that the APCS field has not been initialised to the opposite value.  */
+  /* Make sure that the APCS field has not been initialised to the opposite
+     value.  */
   if (APCS_SET (abfd)
       && (   (APCS_26_FLAG    (abfd) != flag)
          || (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT))
@@ -2084,7 +2103,8 @@ _bfd_coff_arm_set_private_flags (abfd, flags)
 
   flag = (flags & F_INTERWORK);
   
-  /* If either the flags or the BFD do support interworking then do not set the interworking flag.  */
+  /* If either the flags or the BFD do support interworking then do not
+     set the interworking flag.  */
   if (INTERWORK_SET (abfd) && (INTERWORK_FLAG (abfd) != flag))
     flag = 0;
 
@@ -2107,7 +2127,8 @@ coff_arm_copy_private_bfd_data (src, dest)
   if (src == dest)
     return true;
 
-  /* If the destination is not in the same format as the source, do not do the copy.  */
+  /* If the destination is not in the same format as the source, do not do
+     the copy.  */
   if (src->xvec != dest->xvec)
     return true;
 
@@ -2127,14 +2148,16 @@ coff_arm_copy_private_bfd_data (src, dest)
            return false;
        }
       else
-       SET_APCS_FLAGS (dest, APCS_26_FLAG (src) | APCS_FLOAT_FLAG (src) | PIC_FLAG (src));
+       SET_APCS_FLAGS (dest, APCS_26_FLAG (src) | APCS_FLOAT_FLAG (src)
+                       | PIC_FLAG (src));
     }
 
   if (INTERWORK_SET (src))
     {
       if (INTERWORK_SET (dest))
        {
-         /* If the src and dest have different interworking flags then turn off the interworking bit.  */
+         /* If the src and dest have different interworking flags then turn
+            off the interworking bit.  */
          if (INTERWORK_FLAG (dest) != INTERWORK_FLAG (src))
            SET_INTERWORK_FLAG (dest, 0);
        }
@@ -2175,13 +2198,16 @@ coff_arm_is_local_label_name (abfd, name)
     }
 #endif
   
-  /* devo/gcc/config/dbxcoff.h defines ASM_OUTPUT_SOURCE_LINE to generate local line numbers as .LM<number>, so treat these as local.  */
+  /* devo/gcc/config/dbxcoff.h defines ASM_OUTPUT_SOURCE_LINE to generate
+     local line numbers as .LM<number>, so treat these as local.  */
   
   switch (name[0])
     {
     case 'L': return true;
     case '.': return (name[1] == 'L' && name[2] == 'M') ? true : false;
-    default:  return false;     /* Cannot make our minds up - default to false so that it will not be stripped by accident.  */ 
+    default:  return false;     /* Cannot make our minds up - default to
+                                  false so that it will not be stripped
+                                  by accident.  */ 
     }
 }
 
@@ -2198,7 +2224,8 @@ coff_arm_link_output_has_begun (sub, info)
      bfd * sub;
      struct coff_final_link_info * info;
 {
-  return (sub->output_has_begun || sub == coff_arm_hash_table (info->info)->bfd_of_glue_owner);
+  return (sub->output_has_begun
+         || sub == coff_arm_hash_table (info->info)->bfd_of_glue_owner);
 }
 
 static boolean
@@ -2206,7 +2233,9 @@ coff_arm_final_link_postscript (abfd, pfinfo)
      bfd * abfd;
      struct coff_final_link_info * pfinfo;
 {
-  struct coff_arm_link_hash_table * globals = coff_arm_hash_table (pfinfo->info);
+  struct coff_arm_link_hash_table * globals;
+
+  globals = coff_arm_hash_table (pfinfo->info);
   
   BFD_ASSERT (globals != NULL);