BFD messages
[deliverable/binutils-gdb.git] / bfd / bfd.c
index 985c825c6918b33d5b05f99989768a7e14dfc0dd..288b5b14fe202e9f14d1b2b2ee1b53ce1e552cb5 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -451,28 +451,28 @@ static bfd_error_type input_error = bfd_error_no_error;
 
 const char *const bfd_errmsgs[] =
 {
-  N_("No error"),
-  N_("System call error"),
-  N_("Invalid bfd target"),
-  N_("File in wrong format"),
-  N_("Archive object file in wrong format"),
-  N_("Invalid operation"),
-  N_("Memory exhausted"),
-  N_("No symbols"),
-  N_("Archive has no index; run ranlib to add one"),
-  N_("No more archived files"),
-  N_("Malformed archive"),
+  N_("no error"),
+  N_("system call error"),
+  N_("invalid bfd target"),
+  N_("file in wrong format"),
+  N_("archive object file in wrong format"),
+  N_("invalid operation"),
+  N_("memory exhausted"),
+  N_("no symbols"),
+  N_("archive has no index; run ranlib to add one"),
+  N_("no more archived files"),
+  N_("malformed archive"),
   N_("DSO missing from command line"),
-  N_("File format not recognized"),
-  N_("File format is ambiguous"),
-  N_("Section has no contents"),
-  N_("Nonrepresentable section on output"),
-  N_("Symbol needs debug section which does not exist"),
-  N_("Bad value"),
-  N_("File truncated"),
-  N_("File too big"),
-  N_("Error reading %s: %s"),
-  N_("#<Invalid error code>")
+  N_("file format not recognized"),
+  N_("file format is ambiguous"),
+  N_("section has no contents"),
+  N_("nonrepresentable section on output"),
+  N_("symbol needs debug section which does not exist"),
+  N_("bad value"),
+  N_("file truncated"),
+  N_("file too big"),
+  N_("error reading %s: %s"),
+  N_("#<invalid error code>")
 };
 
 /*
@@ -649,10 +649,7 @@ union _bfd_doprnt_args
 };
 
 /* This macro and _bfd_doprnt taken from libiberty _doprnt.c, tidied a
-   little and extended to handle '%A', '%B' and positional parameters.
-   'L' as a modifer for integer formats is used for bfd_vma and
-   bfd_size_type args, which vary in size depending on BFD
-   configuration.  */
+   little and extended to handle '%pA', '%pB' and positional parameters.  */
 
 #define PRINT_TYPE(TYPE, FIELD) \
   do                                                           \
@@ -800,21 +797,6 @@ _bfd_doprnt (FILE *stream, const char *format, union _bfd_doprnt_args *args)
                  PRINT_TYPE (int, i);
                else
                  {
-                   /* L modifier for bfd_vma or bfd_size_type may be
-                      either long long or long.  */
-                   if (ptr[-2] == 'L')
-                     {
-                       sptr[-2] = 'l';
-                       if (BFD_ARCH_SIZE < 64 || BFD_HOST_64BIT_LONG)
-                         wide_width = 1;
-                       else
-                         {
-                           sptr[-1] = 'l';
-                           *sptr++ = ptr[-1];
-                           *sptr = '\0';
-                         }
-                     }
-
                    switch (wide_width)
                      {
                      case 0:
@@ -866,53 +848,55 @@ _bfd_doprnt (FILE *stream, const char *format, union _bfd_doprnt_args *args)
              PRINT_TYPE (char *, p);
              break;
            case 'p':
-             PRINT_TYPE (void *, p);
-             break;
-           case 'A':
-             {
-               asection *sec;
-               bfd *abfd;
-               const char *group = NULL;
-               struct coff_comdat_info *ci;
-
-               sec = (asection *) args[arg_no].p;
-               if (sec == NULL)
-                 /* Invoking %A with a null section pointer is an
-                    internal error.  */
-                 abort ();
-               abfd = sec->owner;
-               if (abfd != NULL
-                   && bfd_get_flavour (abfd) == bfd_target_elf_flavour
-                   && elf_next_in_group (sec) != NULL
-                   && (sec->flags & SEC_GROUP) == 0)
-                 group = elf_group_name (sec);
-               else if (abfd != NULL
-                        && bfd_get_flavour (abfd) == bfd_target_coff_flavour
-                        && (ci = bfd_coff_get_comdat_section (sec->owner,
-                                                              sec)) != NULL)
-                 group = ci->name;
-               if (group != NULL)
-                 result = fprintf (stream, "%s[%s]", sec->name, group);
-               else
-                 result = fprintf (stream, "%s", sec->name);
-             }
-             break;
-           case 'B':
-             {
-               bfd *abfd;
-
-               abfd = (bfd *) args[arg_no].p;
-               if (abfd == NULL)
-                 /* Invoking %B with a null bfd pointer is an
-                    internal error.  */
-                 abort ();
-               else if (abfd->my_archive
-                        && !bfd_is_thin_archive (abfd->my_archive))
-                 result = fprintf (stream, "%s(%s)",
-                                   abfd->my_archive->filename, abfd->filename);
-               else
-                 result = fprintf (stream, "%s", abfd->filename);
-             }
+             if (*ptr == 'A')
+               {
+                 asection *sec;
+                 bfd *abfd;
+                 const char *group = NULL;
+                 struct coff_comdat_info *ci;
+
+                 ptr++;
+                 sec = (asection *) args[arg_no].p;
+                 if (sec == NULL)
+                   /* Invoking %pA with a null section pointer is an
+                      internal error.  */
+                   abort ();
+                 abfd = sec->owner;
+                 if (abfd != NULL
+                     && bfd_get_flavour (abfd) == bfd_target_elf_flavour
+                     && elf_next_in_group (sec) != NULL
+                     && (sec->flags & SEC_GROUP) == 0)
+                   group = elf_group_name (sec);
+                 else if (abfd != NULL
+                          && bfd_get_flavour (abfd) == bfd_target_coff_flavour
+                          && (ci = bfd_coff_get_comdat_section (sec->owner,
+                                                                sec)) != NULL)
+                   group = ci->name;
+                 if (group != NULL)
+                   result = fprintf (stream, "%s[%s]", sec->name, group);
+                 else
+                   result = fprintf (stream, "%s", sec->name);
+               }
+             else if (*ptr == 'B')
+               {
+                 bfd *abfd;
+
+                 ptr++;
+                 abfd = (bfd *) args[arg_no].p;
+                 if (abfd == NULL)
+                   /* Invoking %pB with a null bfd pointer is an
+                      internal error.  */
+                   abort ();
+                 else if (abfd->my_archive
+                          && !bfd_is_thin_archive (abfd->my_archive))
+                   result = fprintf (stream, "%s(%s)",
+                                     abfd->my_archive->filename,
+                                     abfd->filename);
+                 else
+                   result = fprintf (stream, "%s", abfd->filename);
+               }
+             else
+               PRINT_TYPE (void *, p);
              break;
            default:
              abort();
@@ -1049,12 +1033,6 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args)
                  arg_type = Int;
                else
                  {
-                   if (ptr[-2] == 'L')
-                     {
-                       if (BFD_ARCH_SIZE < 64 || BFD_HOST_64BIT_LONG)
-                         wide_width = 1;
-                     }
-
                    switch (wide_width)
                      {
                      case 0:
@@ -1094,9 +1072,11 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args)
              }
              break;
            case 's':
+             arg_type = Ptr;
+             break;
            case 'p':
-           case 'A':
-           case 'B':
+             if (*ptr == 'A' || *ptr == 'B')
+               ptr++;
              arg_type = Ptr;
              break;
            default:
@@ -1116,8 +1096,8 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args)
 /* This is the default routine to handle BFD error messages.
    Like fprintf (stderr, ...), but also handles some extra format specifiers.
 
-   %A section name from section.  For group components, prints group name too.
-   %B file name from bfd.  For archive components, prints archive too.
+   %pA section name from section.  For group components, prints group name too.
+   %pB file name from bfd.  For archive components, prints archive too.
 
    Beware: Only supports a maximum of 9 format arguments.  */
 
This page took 0.035285 seconds and 4 git commands to generate.