+ {
+ lfinfo (fp, "%pB:", abfd);
+ done = FALSE;
+ }
+ if (!done)
+ lfinfo (fp, "(%pA+0x%v)", section, offset);
+
+ if (discard_last)
+ {
+ last_bfd = NULL;
+ if (last_file != NULL)
+ {
+ free (last_file);
+ last_file = NULL;
+ }
+ if (last_function != NULL)
+ {
+ free (last_function);
+ last_function = NULL;
+ }
+ }
+ }
+ break;
+
+ case 'p':
+ if (*fmt == 'A')
+ {
+ /* section name from a section */
+ asection *sec;
+ bfd *abfd;
+ const char *group = NULL;
+ struct coff_comdat_info *ci;
+
+ fmt++;
+ sec = (asection *) args[arg_no].p;
+ ++arg_count;
+ abfd = sec->owner;
+ fprintf (fp, "%s", sec->name);
+ 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)
+ fprintf (fp, "[%s]", group);
+ }
+ else if (*fmt == 'B')
+ {
+ /* filename from a bfd */
+ bfd *abfd = (bfd *) args[arg_no].p;
+
+ fmt++;
+ ++arg_count;
+ if (abfd == NULL)
+ fprintf (fp, "%s generated", program_name);
+ else if (abfd->my_archive != NULL
+ && !bfd_is_thin_archive (abfd->my_archive))
+ fprintf (fp, "%s(%s)", abfd->my_archive->filename,
+ abfd->filename);
+ else
+ fprintf (fp, "%s", abfd->filename);
+ }
+ else if (*fmt == 'I')
+ {
+ /* filename from a lang_input_statement_type */
+ lang_input_statement_type *i;
+
+ fmt++;
+ i = (lang_input_statement_type *) args[arg_no].p;
+ ++arg_count;
+ if (i->the_bfd->my_archive != NULL
+ && !bfd_is_thin_archive (i->the_bfd->my_archive))
+ fprintf (fp, "(%s)",
+ bfd_get_filename (i->the_bfd->my_archive));
+ fprintf (fp, "%s", i->local_sym_name);
+ if ((i->the_bfd->my_archive == NULL
+ || bfd_is_thin_archive (i->the_bfd->my_archive))
+ && filename_cmp (i->local_sym_name, i->filename) != 0)
+ fprintf (fp, " (%s)", i->filename);
+ }
+ else if (*fmt == 'R')
+ {
+ /* Print all that's interesting about a relent. */
+ arelent *relent = (arelent *) args[arg_no].p;
+
+ fmt++;
+ ++arg_count;
+ lfinfo (fp, "%s+0x%v (type %s)",
+ (*(relent->sym_ptr_ptr))->name,
+ relent->addend,
+ relent->howto->name);
+ }
+ else if (*fmt == 'S')
+ {
+ /* Print script file and linenumber. */
+ etree_type node;
+ etree_type *tp = (etree_type *) args[arg_no].p;
+
+ fmt++;
+ ++arg_count;
+ if (tp == NULL)
+ {
+ tp = &node;
+ tp->type.filename = ldlex_filename ();
+ tp->type.lineno = lineno;
+ }
+ if (tp->type.filename != NULL)
+ fprintf (fp, "%s:%u", tp->type.filename, tp->type.lineno);
+ }
+ else if (*fmt == 'T')
+ {
+ /* Symbol name. */
+ const char *name = (const char *) args[arg_no].p;
+
+ fmt++;
+ ++arg_count;
+ if (name == NULL || *name == 0)
+ {
+ fprintf (fp, _("no symbol"));
+ break;
+ }
+ else if (demangling)
+ {
+ char *demangled;
+
+ demangled = bfd_demangle (link_info.output_bfd, name,
+ DMGL_ANSI | DMGL_PARAMS);
+ if (demangled != NULL)
+ {
+ fprintf (fp, "%s", demangled);
+ free (demangled);
+ break;
+ }
+ }
+ fprintf (fp, "%s", name);
+ }
+ else
+ {
+ /* native (host) void* pointer, like printf */
+ fprintf (fp, "%p", args[arg_no].p);
+ ++arg_count;
+ }
+ break;
+
+ case 's':
+ /* arbitrary string, like printf */
+ fprintf (fp, "%s", (char *) args[arg_no].p);
+ ++arg_count;
+ break;
+
+ case 'd':
+ /* integer, like printf */
+ fprintf (fp, "%d", args[arg_no].i);
+ ++arg_count;
+ break;
+
+ case 'u':
+ /* unsigned integer, like printf */
+ fprintf (fp, "%u", args[arg_no].i);
+ ++arg_count;
+ break;
+
+ case 'l':
+ if (*fmt == 'd')
+ {
+ fprintf (fp, "%ld", args[arg_no].l);
+ ++arg_count;
+ ++fmt;
+ break;
+ }
+ else if (*fmt == 'u')
+ {
+ fprintf (fp, "%lu", args[arg_no].l);
+ ++arg_count;
+ ++fmt;
+ break;
+ }
+ /* Fallthru */
+
+ default:
+ fprintf (fp, "%%%c", fmt[-1]);
+ break;