Please don't add declarations of random system functions to general

source files if you can possibly avoid it.  They inevitably fail on
some system somewhere.

	* objdump.c: Removed useless fprintf declaration.
This commit is contained in:
Ian Lance Taylor 1993-04-09 18:22:57 +00:00
parent 21486670ae
commit 545a27683e
2 changed files with 19 additions and 16 deletions

View File

@ -1,3 +1,7 @@
Fri Apr 9 11:21:00 1993 Ian Lance Taylor (ian@cygnus.com)
* objdump.c: Removed useless fprintf declaration.
Wed Apr 7 22:22:50 1993 Rob Savoye (rob@cygnus.com) Wed Apr 7 22:22:50 1993 Rob Savoye (rob@cygnus.com)
* Makefile.in: Changed check target to use DejaGnu. * Makefile.in: Changed check target to use DejaGnu.

View File

@ -43,7 +43,6 @@ extern Elf_Internal_Shdr *bfd_elf_find_section();
#endif /* ELF_STAB_DISPLAY */ #endif /* ELF_STAB_DISPLAY */
extern char *xmalloc (); extern char *xmalloc ();
extern int fprintf PARAMS ((FILE *, CONST char *, ...));
char *default_target = NULL; /* default at runtime */ char *default_target = NULL; /* default at runtime */
@ -209,9 +208,9 @@ comp (ap, bp)
/* Print the supplied address symbolically if possible */ /* Print the supplied address symbolically if possible */
void void
print_address (vma, stream) objdump_print_address (vma, info)
bfd_vma vma; bfd_vma vma;
FILE *stream; struct disassemble_info *info;
{ {
/* Perform a binary search looking for the closest symbol to /* Perform a binary search looking for the closest symbol to
the required value */ the required value */
@ -226,7 +225,7 @@ print_address (vma, stream)
if (symcount == 0) if (symcount == 0)
{ {
fprintf_vma (stream, vma); fprintf_vma (info->stream, vma);
} }
else else
{ {
@ -267,8 +266,8 @@ print_address (vma, stream)
&& syms[thisplace + 1]->value == vma) && syms[thisplace + 1]->value == vma)
match_name = syms[thisplace + 1]->name; match_name = syms[thisplace + 1]->name;
/* Totally awesome! the exact right symbol */ /* Totally awesome! the exact right symbol */
fprintf_vma (stream, vma); fprintf_vma (info->stream, vma);
fprintf (stream, " (%s+)0000", syms[thisplace]->name); fprintf (info->stream, " (%s+)0000", syms[thisplace]->name);
return; return;
} }
} }
@ -285,16 +284,16 @@ print_address (vma, stream)
} }
} }
fprintf_vma (stream, vma); fprintf_vma (info->stream, vma);
if (syms[thisplace]->value > vma) if (syms[thisplace]->value > vma)
{ {
fprintf (stream, " (%s-)", syms[thisplace]->name); fprintf (info->stream, " (%s-)", syms[thisplace]->name);
fprintf (stream, "%04x", syms[thisplace]->value - vma); fprintf (info->stream, "%04x", syms[thisplace]->value - vma);
} }
else else
{ {
fprintf (stream, " (%s+)", syms[thisplace]->name); fprintf (info->stream, " (%s+)", syms[thisplace]->name);
fprintf (stream, "%04x", vma - syms[thisplace]->value); fprintf (info->stream, "%04x", vma - syms[thisplace]->value);
} }
} }
} }
@ -309,8 +308,6 @@ disassemble_data (abfd)
bfd_size_type i; bfd_size_type i;
unsigned int (*print) ()= 0; /* Old style */ unsigned int (*print) ()= 0; /* Old style */
disassembler_ftype disassemble = 0; /* New style */ disassembler_ftype disassemble = 0; /* New style */
unsigned int print_insn_a29k ();
unsigned int print_insn_i960 ();
unsigned int print_insn_h8300 (); unsigned int print_insn_h8300 ();
enum bfd_architecture a; enum bfd_architecture a;
struct disassemble_info disasm_info; struct disassemble_info disasm_info;
@ -324,6 +321,7 @@ disassemble_data (abfd)
boolean done_dot = false; boolean done_dot = false;
INIT_DISASSEMBLE_INFO(disasm_info, stdout); INIT_DISASSEMBLE_INFO(disasm_info, stdout);
disasm_info.print_address_func = objdump_print_address;
for (i = 0; i < symcount; i++) for (i = 0; i < symcount; i++)
{ {
@ -395,10 +393,11 @@ disassemble_data (abfd)
disassemble = print_insn_m68k; disassemble = print_insn_m68k;
break; break;
case bfd_arch_a29k: case bfd_arch_a29k:
print = print_insn_a29k; /* As far as I know we only handle big-endian 29k objects. */
disassemble = print_insn_big_a29k;
break; break;
case bfd_arch_i960: case bfd_arch_i960:
print = print_insn_i960; disassemble = print_insn_i960;
break; break;
case bfd_arch_mips: case bfd_arch_mips:
if (abfd->xvec->byteorder_big_p) if (abfd->xvec->byteorder_big_p)
@ -488,7 +487,7 @@ disassemble_data (abfd)
} }
} }
} }
print_address (section->vma + i, stdout); objdump_print_address (section->vma + i, &disasm_info);
printf (" "); printf (" ");
if (disassemble) /* New style */ if (disassemble) /* New style */