+
+ case 'p':
+ if (*fmt == 'A')
+ {
+ /* section name from a section */
+ asection *sec;
+ bfd *abfd;
+
+ fmt++;
+ sec = (asection *) args[arg_no].p;
+ ++arg_count;
+ fprintf (fp, "%s", sec->name);
+ abfd = sec->owner;
+ if (abfd != NULL)
+ {
+ const char *group = bfd_group_name (abfd, sec);
+ 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)",
+ bfd_get_filename (abfd->my_archive),
+ bfd_get_filename (abfd));
+ else
+ fprintf (fp, "%s", bfd_get_filename (abfd));
+ }
+ 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 != NULL
+ && i->the_bfd->my_archive != NULL
+ && !bfd_is_thin_archive (i->the_bfd->my_archive))
+ fprintf (fp, "(%s)%s",
+ bfd_get_filename (i->the_bfd->my_archive),
+ i->local_sym_name);
+ else
+ 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;
+