+ switch (ptr[-1])
+ {
+ case 'd':
+ case 'i':
+ case 'o':
+ case 'u':
+ case 'x':
+ case 'X':
+ case 'c':
+ {
+ /* Short values are promoted to int, so just copy it
+ as an int and trust the C library printf to cast it
+ to the right width. */
+ if (short_width)
+ PRINT_TYPE (int);
+ else
+ {
+ switch (wide_width)
+ {
+ case 0:
+ PRINT_TYPE (int);
+ break;
+ case 1:
+ PRINT_TYPE (long);
+ break;
+ case 2:
+ default:
+#if defined(__GNUC__) || defined(HAVE_LONG_LONG)
+ PRINT_TYPE (long long);
+#else
+ /* Fake it and hope for the best. */
+ PRINT_TYPE (long);
+#endif
+ break;
+ }
+ }
+ }
+ break;
+ case 'f':
+ case 'e':
+ case 'E':
+ case 'g':
+ case 'G':
+ {
+ if (wide_width == 0)
+ PRINT_TYPE (double);
+ else
+ {
+#if defined(__GNUC__) || defined(HAVE_LONG_DOUBLE)
+ PRINT_TYPE (long double);
+#else
+ /* Fake it and hope for the best. */
+ PRINT_TYPE (double);
+#endif
+ }
+ }
+ break;
+ case 's':
+ PRINT_TYPE (char *);
+ break;
+ case 'p':
+ PRINT_TYPE (void *);
+ break;
+ case '%':
+ fputc ('%', stream);
+ result = 1;
+ break;
+ case 'A':
+ {
+ asection *sec = va_arg (ap, asection *);
+ bfd *abfd;
+ const char *group = NULL;
+ struct coff_comdat_info *ci;
+
+ 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 = va_arg (ap, bfd *);
+
+ 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);
+ }
+ break;
+ default:
+ abort();