+ case '\0':
+ --fmt;
+ /* Fall through. */
+
+ case '%':
+ /* literal % */
+ putc ('%', fp);
+ break;
+
+ case 'X':
+ /* no object output, fail return */
+ config.make_executable = FALSE;
+ break;
+
+ case 'V':
+ /* hex bfd_vma */
+ {
+ bfd_vma value = args[arg_no].v;
+ ++arg_count;
+ fprintf_vma (fp, value);
+ }
+ break;
+
+ case 'v':
+ /* hex bfd_vma, no leading zeros */
+ {
+ char buf[100];
+ char *p = buf;
+ bfd_vma value = args[arg_no].v;
+ ++arg_count;
+ sprintf_vma (p, value);
+ while (*p == '0')
+ p++;
+ if (!*p)
+ p--;
+ fputs (p, fp);
+ }
+ break;
+
+ case 'W':
+ /* hex bfd_vma with 0x with no leading zeroes taking up
+ 8 spaces. */
+ {
+ char buf[100];
+ bfd_vma value;
+ char *p;
+ int len;
+
+ value = args[arg_no].v;
+ ++arg_count;
+ sprintf_vma (buf, value);
+ for (p = buf; *p == '0'; ++p)
+ ;
+ if (*p == '\0')
+ --p;
+ len = strlen (p);
+ while (len < 8)
+ {
+ putc (' ', fp);
+ ++len;
+ }
+ fprintf (fp, "0x%s", p);
+ }
+ break;
+
+ case 'F':
+ /* Error is fatal. */
+ fatal = TRUE;
+ break;
+
+ case 'P':
+ /* Print program name. */
+ fprintf (fp, "%s", program_name);
+ break;
+
+ case 'E':
+ /* current bfd error or errno */
+ fprintf (fp, "%s", bfd_errmsg (bfd_get_error ()));
+ break;
+
+ case 'C':
+ case 'D':
+ case 'G':
+ case 'H':
+ /* Clever filename:linenumber with function name if possible.
+ The arguments are a BFD, a section, and an offset. */
+ {
+ static bfd *last_bfd;
+ static char *last_file;
+ static char *last_function;
+ bfd *abfd;
+ asection *section;
+ bfd_vma offset;
+ asymbol **asymbols = NULL;
+ const char *filename;
+ const char *functionname;
+ unsigned int linenumber;
+ bfd_boolean discard_last;
+ bfd_boolean done;
+ bfd_error_type last_bfd_error = bfd_get_error ();
+
+ abfd = args[arg_no].reladdr.abfd;
+ section = args[arg_no].reladdr.sec;
+ offset = args[arg_no].reladdr.off;
+ ++arg_count;
+
+ if (abfd != NULL)
+ {
+ if (!bfd_generic_link_read_symbols (abfd))
+ einfo (_("%F%P: %pB: could not read symbols: %E\n"), abfd);
+
+ asymbols = bfd_get_outsymbols (abfd);
+ }
+
+ /* The GNU Coding Standard requires that error messages
+ be of the form:
+
+ source-file-name:lineno: message
+
+ We do not always have a line number available so if
+ we cannot find them we print out the section name and
+ offset instead. */
+ discard_last = TRUE;
+ if (abfd != NULL
+ && bfd_find_nearest_line (abfd, section, asymbols, offset,
+ &filename, &functionname,
+ &linenumber))
+ {
+ if (functionname != NULL
+ && (fmt[-1] == 'C' || fmt[-1] == 'H'))
+ {
+ /* Detect the case where we are printing out a
+ message for the same function as the last
+ call to vinfo ("%C"). In this situation do
+ not print out the ABFD filename or the
+ function name again. Note - we do still
+ print out the source filename, as this will
+ allow programs that parse the linker's output
+ (eg emacs) to correctly locate multiple
+ errors in the same source file. */
+ if (last_bfd == NULL
+ || last_function == NULL
+ || last_bfd != abfd
+ || (last_file == NULL) != (filename == NULL)
+ || (filename != NULL
+ && filename_cmp (last_file, filename) != 0)
+ || strcmp (last_function, functionname) != 0)
+ {
+ lfinfo (fp, _("%pB: in function `%pT':\n"),
+ abfd, functionname);
+
+ last_bfd = abfd;
+ free (last_file);
+ last_file = NULL;
+ if (filename)
+ last_file = xstrdup (filename);
+ free (last_function);
+ last_function = xstrdup (functionname);
+ }
+ discard_last = FALSE;
+ }
+ else
+ lfinfo (fp, "%pB:", abfd);
+
+ if (filename != NULL)
+ fprintf (fp, "%s:", filename);
+
+ done = fmt[-1] != 'H';
+ if (functionname != NULL && fmt[-1] == 'G')
+ lfinfo (fp, "%pT", functionname);
+ else if (filename != NULL && linenumber != 0)
+ fprintf (fp, "%u%s", linenumber, done ? "" : ":");
+ else
+ done = FALSE;
+ }
+ else
+ {
+ lfinfo (fp, "%pB:", abfd);
+ done = FALSE;
+ }
+ if (!done)
+ lfinfo (fp, "(%pA+0x%v)", section, offset);
+ bfd_set_error (last_bfd_error);
+
+ if (discard_last)
+ {
+ last_bfd = NULL;
+ free (last_file);
+ last_file = NULL;
+ free (last_function);
+ last_function = NULL;
+ }
+ }
+ break;
+
+ 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')