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>")
};
/*
};
/* 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 \
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:
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();
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:
}
break;
case 's':
+ arg_type = Ptr;
+ break;
case 'p':
- case 'A':
- case 'B':
+ if (*ptr == 'A' || *ptr == 'B')
+ ptr++;
arg_type = Ptr;
break;
default:
/* 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. */