aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1993-04-29 06:45:39 +0000
committerDavid MacKenzie <djm@cygnus>1993-04-29 06:45:39 +0000
commitd244269886c8448239b88126983243481eeb71b3 (patch)
treefeb10d9a6ba6f8946d0ff0bbdc32825f13b718f5 /binutils/objdump.c
parentb703c078e291a2deb52906c3fbb5fe9fceebf6bc (diff)
downloadgdb-d244269886c8448239b88126983243481eeb71b3.zip
gdb-d244269886c8448239b88126983243481eeb71b3.tar.gz
gdb-d244269886c8448239b88126983243481eeb71b3.tar.bz2
Clean up usage messages and option parsers.
Add program name to some error messages.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 1c1c589..545293b 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -88,10 +88,10 @@ dump_symbols PARAMS ((bfd *abfd));
void
usage ()
{
- fprintf (stderr, "\
-usage: %s [-ahifdrtxsl] [-m machine] [-j section_name]\n\
- [--syms] [--reloc] [--header] [--version] obj ...\n",
- program_name);
+ fprintf (stderr, "objdump %s\n\
+Usage: %s [-ahifdrtxsl] [-m machine] [-j section_name] [-b bfdname]\n\
+ [--syms] [--reloc] [--header] [--version] objfile...\n",
+ program_version, program_name);
exit (1);
}
@@ -104,7 +104,8 @@ static struct option long_options[]=
#ifdef ELF_STAB_DISPLAY
{"stabs", no_argument, &dump_stab_section_info, 1},
#endif
- {0, no_argument, 0, 0}};
+ {0, no_argument, 0, 0}
+};
static void
@@ -745,6 +746,7 @@ display_file (filename, target)
file = bfd_openr (filename, target);
if (file == NULL)
{
+ fprintf (stderr, "%s: ", program_name);
bfd_perror (filename);
return;
}
@@ -760,7 +762,10 @@ display_file (filename, target)
if (arfile == NULL)
{
if (bfd_error != no_more_archived_files)
- bfd_perror (bfd_get_filename (file));
+ {
+ fprintf (stderr, "%s: ", program_name);
+ bfd_perror (bfd_get_filename (file));
+ }
return;
}
@@ -1052,12 +1057,12 @@ main (argc, argv)
extern char *optarg;
char *target = default_target;
boolean seenflag = false;
- int ind = 0;
bfd_init ();
program_name = *argv;
- while ((c = getopt_long (argc, argv, "ib:m:Vdlfahrtxsj:", long_options, &ind))
+ while ((c = getopt_long (argc, argv, "ib:m:Vdlfahrtxsj:", long_options,
+ (int *) 0))
!= EOF)
{
seenflag = true;