* ldmisc.c (vfinfo): Reindent.

This commit is contained in:
Ian Lance Taylor 1996-04-26 18:42:55 +00:00
parent e25a798839
commit f0f80b13f8
2 changed files with 251 additions and 244 deletions

View File

@ -1,3 +1,7 @@
Fri Apr 26 14:42:27 1996 Ian Lance Taylor <ian@cygnus.com>
* ldmisc.c (vfinfo): Reindent.
Mon Apr 22 12:07:32 1996 Ian Lance Taylor <ian@cygnus.com> Mon Apr 22 12:07:32 1996 Ian Lance Taylor <ian@cygnus.com>
* ldlang.c (lang_size_sections): If _cooked_size is not 0, then * ldlang.c (lang_size_sections): If _cooked_size is not 0, then

View File

@ -1,6 +1,5 @@
/* ldmisc.c /* ldmisc.c
Copyright (C) 1991, 92, 93, 94 Free Software Foundation, Inc. Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support. Written by Steve Chamberlain of Cygnus Support.
This file is part of GLD, the Gnu Linker. This file is part of GLD, the Gnu Linker.
@ -102,11 +101,11 @@ vfinfo (fp, fmt, arg)
{ {
boolean fatal = false; boolean fatal = false;
while (*fmt) while (*fmt != '\0')
{ {
while (*fmt != '%' && *fmt != '\0') while (*fmt != '%' && *fmt != '\0')
{ {
putc(*fmt, fp); putc (*fmt, fp);
fmt++; fmt++;
} }
@ -116,12 +115,12 @@ vfinfo (fp, fmt, arg)
switch (*fmt++) switch (*fmt++)
{ {
default: default:
fprintf(fp,"%%%c", fmt[-1]); fprintf (fp,"%%%c", fmt[-1]);
break; break;
case '%': case '%':
/* literal % */ /* literal % */
putc('%', fp); putc ('%', fp);
break; break;
case 'X': case 'X':
@ -132,8 +131,8 @@ vfinfo (fp, fmt, arg)
case 'V': case 'V':
/* hex bfd_vma */ /* hex bfd_vma */
{ {
bfd_vma value = va_arg(arg, bfd_vma); bfd_vma value = va_arg (arg, bfd_vma);
fprintf_vma(fp, value); fprintf_vma (fp, value);
} }
break; break;
@ -167,14 +166,12 @@ vfinfo (fp, fmt, arg)
case 'B': case 'B':
/* filename from a bfd */ /* filename from a bfd */
{ {
bfd *abfd = va_arg(arg, bfd *); bfd *abfd = va_arg (arg, bfd *);
if (abfd->my_archive) { if (abfd->my_archive)
fprintf(fp,"%s(%s)", abfd->my_archive->filename, fprintf (fp, "%s(%s)", abfd->my_archive->filename,
abfd->filename); abfd->filename);
} else
else { fprintf (fp, "%s", abfd->filename);
fprintf(fp,"%s", abfd->filename);
}
} }
break; break;
@ -185,23 +182,27 @@ vfinfo (fp, fmt, arg)
case 'P': case 'P':
/* print program name */ /* print program name */
fprintf(fp,"%s", program_name); fprintf (fp, "%s", program_name);
break; break;
case 'E': case 'E':
/* current bfd error or errno */ /* current bfd error or errno */
fprintf(fp, bfd_errmsg(bfd_get_error ())); fprintf (fp, bfd_errmsg (bfd_get_error ()));
break; break;
case 'I': case 'I':
/* filename from a lang_input_statement_type */ /* filename from a lang_input_statement_type */
{ {
lang_input_statement_type *i = lang_input_statement_type *i;
va_arg(arg,lang_input_statement_type *);
if (i->the_bfd->my_archive) i = va_arg (arg, lang_input_statement_type *);
fprintf(fp, "(%s)", i->the_bfd->my_archive->filename); if (bfd_my_archive (i->the_bfd) != NULL)
fprintf(fp,"%s", i->local_sym_name); fprintf (fp, "(%s)",
bfd_get_filename (bfd_my_archive (i->the_bfd)));
fprintf (fp, "%s", i->local_sym_name);
if (bfd_my_archive (i->the_bfd) == NULL
&& strcmp (i->local_sym_name, i->filename) != 0)
fprintf (fp, " (%s)", i->filename);
} }
break; break;
@ -218,7 +219,7 @@ vfinfo (fp, fmt, arg)
case 'R': case 'R':
/* Print all that's interesting about a relent */ /* Print all that's interesting about a relent */
{ {
arelent *relent = va_arg(arg, arelent *); arelent *relent = va_arg (arg, arelent *);
finfo (fp, "%s+0x%v (type %s)", finfo (fp, "%s+0x%v (type %s)",
(*(relent->sym_ptr_ptr))->name, (*(relent->sym_ptr_ptr))->name,
@ -275,7 +276,8 @@ vfinfo (fp, fmt, arg)
discard_last = true; discard_last = true;
if (bfd_find_nearest_line (abfd, section, asymbols, offset, if (bfd_find_nearest_line (abfd, section, asymbols, offset,
&filename, &functionname, &linenumber)) &filename, &functionname,
&linenumber))
{ {
if (functionname != NULL && fmt[-1] == 'C') if (functionname != NULL && fmt[-1] == 'C')
{ {
@ -307,7 +309,8 @@ vfinfo (fp, fmt, arg)
if (linenumber != 0) if (linenumber != 0)
fprintf (fp, "%s:%u", filename, linenumber); fprintf (fp, "%s:%u", filename, linenumber);
else else
finfo (fp, "%s(%s+0x%v)", filename, section->name, offset); finfo (fp, "%s(%s+0x%v)", filename, section->name,
offset);
} }
else if (filename == NULL else if (filename == NULL
|| strcmp (filename, abfd->filename) == 0) || strcmp (filename, abfd->filename) == 0)
@ -344,17 +347,17 @@ vfinfo (fp, fmt, arg)
case 's': case 's':
/* arbitrary string, like printf */ /* arbitrary string, like printf */
fprintf(fp,"%s", va_arg(arg, char *)); fprintf (fp, "%s", va_arg (arg, char *));
break; break;
case 'd': case 'd':
/* integer, like printf */ /* integer, like printf */
fprintf(fp,"%d", va_arg(arg, int)); fprintf (fp, "%d", va_arg (arg, int));
break; break;
case 'u': case 'u':
/* unsigned integer, like printf */ /* unsigned integer, like printf */
fprintf(fp,"%u", va_arg(arg, unsigned int)); fprintf (fp,"%u", va_arg (arg, unsigned int));
break; break;
} }
} }