* bucomm.c (bfd_nonfatal): Flush stdout before output to stderr.

(bfd_nonfatal_message, report, list_matching_formats): Likewise.
	(list_supported_targets): Tidy.
	* objdump.c (free_only_list): Formatting.
	(slurp_dynamic_symtab): Non-zero exit status for "not a dynamic
	object".
	(update_source_path): Delete redundant check for NULL filename.
	(disassemble_bytes): Error if disassemble_fn returns a value
	that won't increment address.
	(disassemble_data): Don't capitalize error message.
	(read_section_stabs): Likewise.
	(main): Return non-zero exit status on bad options.
This commit is contained in:
Alan Modra 2010-10-05 05:48:10 +00:00
parent ea65fe05d0
commit a8c62f1c04
3 changed files with 44 additions and 15 deletions

View file

@ -393,7 +393,8 @@ free_only_list (void)
{
if (! at_least_one_seen)
{
non_fatal (_("Section '%s' mentioned in a -j option, but not found in any input file"),
non_fatal (_("section '%s' mentioned in a -j option, "
"but not found in any input file"),
only->name);
exit_status = 1;
}
@ -555,6 +556,7 @@ slurp_dynamic_symtab (bfd *abfd)
if (!(bfd_get_file_flags (abfd) & DYNAMIC))
{
non_fatal (_("%s: not a dynamic object"), bfd_get_filename (abfd));
exit_status = 1;
dynsymcount = 0;
return NULL;
}
@ -1210,9 +1212,6 @@ update_source_path (const char *filename)
const char *fname;
int i;
if (filename == NULL)
return NULL;
p = try_print_file_open (filename, filename);
if (p != NULL)
return p;
@ -1626,10 +1625,16 @@ disassemble_bytes (struct disassemble_info * inf,
inf->stream = stdout;
if (insn_width == 0 && inf->bytes_per_line != 0)
octets_per_line = inf->bytes_per_line;
if (octets < 0)
if (octets < (int) opb)
{
if (sfile.pos)
printf ("%s\n", sfile.buffer);
if (octets >= 0)
{
non_fatal (_("disassemble_fn returned length %d"),
octets);
exit_status = 1;
}
break;
}
}
@ -2107,7 +2112,7 @@ disassemble_data (bfd *abfd)
const bfd_arch_info_type *inf = bfd_scan_arch (machine);
if (inf == NULL)
fatal (_("Can't use supplied machine %s"), machine);
fatal (_("can't use supplied machine %s"), machine);
abfd->arch_info = inf;
}
@ -2126,7 +2131,7 @@ disassemble_data (bfd *abfd)
aux.disassemble_fn = disassembler (abfd);
if (!aux.disassemble_fn)
{
non_fatal (_("Can't disassemble for architecture %s\n"),
non_fatal (_("can't disassemble for architecture %s\n"),
bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
exit_status = 1;
return;
@ -2396,11 +2401,11 @@ read_section_stabs (bfd *abfd, const char *sect_name, bfd_size_type *size_ptr)
if (! bfd_get_section_contents (abfd, stabsect, contents, 0, size))
{
non_fatal (_("Reading %s section of %s failed: %s"),
non_fatal (_("reading %s section of %s failed: %s"),
sect_name, bfd_get_filename (abfd),
bfd_errmsg (bfd_get_error ()));
free (contents);
exit_status = 1;
free (contents);
return NULL;
}
@ -3350,7 +3355,7 @@ main (int argc, char **argv)
endian = BFD_ENDIAN_LITTLE;
else
{
non_fatal (_("unrecognized -E option"));
nonfatal (_("unrecognized -E option"));
usage (stderr, 1);
}
break;
@ -3362,6 +3367,7 @@ main (int argc, char **argv)
else
{
non_fatal (_("unrecognized --endian type `%s'"), optarg);
exit_status = 1;
usage (stderr, 1);
}
break;