diff options
author | Alan Modra <amodra@gmail.com> | 2010-10-05 05:48:10 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2010-10-05 05:48:10 +0000 |
commit | a8c62f1c04868c432611f443d0fac5ac5bbadae9 (patch) | |
tree | d86ada501b7187e1c5ab40b23261c551a9206893 /binutils/bucomm.c | |
parent | * cc-with-index.sh: New file. (diff) | |
download | binutils-gdb-a8c62f1c04868c432611f443d0fac5ac5bbadae9.tar.gz binutils-gdb-a8c62f1c04868c432611f443d0fac5ac5bbadae9.tar.bz2 binutils-gdb-a8c62f1c04868c432611f443d0fac5ac5bbadae9.zip |
* 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.
Diffstat (limited to 'binutils/bucomm.c')
-rw-r--r-- | binutils/bucomm.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/binutils/bucomm.c b/binutils/bucomm.c index e568b031ab9..ccde4bc9620 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -1,6 +1,6 @@ /* bucomm.c -- Bin Utils COMmon code. Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, - 2003, 2005, 2006, 2007, 2008, 2009 + 2003, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -52,8 +52,10 @@ char *program_name; void bfd_nonfatal (const char *string) { - const char *errmsg = bfd_errmsg (bfd_get_error ()); + const char *errmsg; + fflush (stdout); + errmsg = bfd_errmsg (bfd_get_error ()); if (string) fprintf (stderr, "%s: %s: %s\n", program_name, string, errmsg); else @@ -78,10 +80,13 @@ bfd_nonfatal_message (const char *filename, const asection *section, const char *format, ...) { - const char *errmsg = bfd_errmsg (bfd_get_error ()); - const char *section_name = NULL; + const char *errmsg; + const char *section_name; va_list args; + fflush (stdout); + errmsg = bfd_errmsg (bfd_get_error ()); + section_name = NULL; va_start (args, format); fprintf (stderr, "%s", program_name); @@ -116,6 +121,7 @@ bfd_fatal (const char *string) void report (const char * format, va_list args) { + fflush (stdout); fprintf (stderr, "%s: ", program_name); vfprintf (stderr, format, args); putc ('\n', stderr); @@ -165,6 +171,7 @@ set_default_bfd_target (void) void list_matching_formats (char **p) { + fflush (stdout); fprintf (stderr, _("%s: Matching formats:"), program_name); while (*p) fprintf (stderr, " %s", *p++); @@ -177,13 +184,14 @@ void list_supported_targets (const char *name, FILE *f) { int t; - const char **targ_names = bfd_target_list (); + const char **targ_names; if (name == NULL) fprintf (f, _("Supported targets:")); else fprintf (f, _("%s: supported targets:"), name); + targ_names = bfd_target_list (); for (t = 0; targ_names[t] != NULL; t++) fprintf (f, " %s", targ_names[t]); fprintf (f, "\n"); |