aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-06-22 22:28:49 +0000
committerIan Lance Taylor <ian@airs.com>1998-06-22 22:28:49 +0000
commit59bbaa1950af91de0a6ce6127d1622cd9211daa8 (patch)
tree6dad77271811ac54a54bc5719e7f8e2c6bfab0d8 /binutils/readelf.c
parent573916e3774831a87eb4780dc4c24cd98e5dafb2 (diff)
downloadgdb-59bbaa1950af91de0a6ce6127d1622cd9211daa8.zip
gdb-59bbaa1950af91de0a6ce6127d1622cd9211daa8.tar.gz
gdb-59bbaa1950af91de0a6ce6127d1622cd9211daa8.tar.bz2
* readelf.c: Include bfd.h and bucomm.h before system header
files. (parse_args): Change type of c from char to int.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c51
1 files changed, 28 insertions, 23 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 450675a..c0e16ae 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -20,14 +20,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-
+
+#include "bfd.h"
+#include "bucomm.h"
#include <assert.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include "readelf.h"
-#include "bucomm.h"
#include "getopt.h"
#ifdef ANSI_PROTOTYPES
@@ -1015,26 +1016,27 @@ struct option options [] =
static void
usage ()
{
- fprintf (stderr, _("Usage: readelf {options} elf-file(s)\n"));
- fprintf (stderr, _(" Options are:\n"));
- fprintf (stderr, _(" -a or --all Display all the information\n"));
- fprintf (stderr, _(" -h or --file-header Display the ELF file header\n"));
- fprintf (stderr, _(" -l or --program-headers or --segments\n"));
- fprintf (stderr, _(" Display the program headers\n"));
- fprintf (stderr, _(" -S or --sections Display the sections' headers\n"));
- fprintf (stderr, _(" -s or --symbols Display the symbol table\n"));
- fprintf (stderr, _(" -r or --relocs Display the relocations (if present)\n"));
- fprintf (stderr, _(" -d or --dynamic Display the dynamic section (if present)\n"));
- fprintf (stderr, _(" -V or --version-info Display the version sections (if present)\n"));
- fprintf (stderr, _(" -D or --use-dynamic Use the dynamic section info when displaying symbols\n"));
- fprintf (stderr, _(" -x <number> or --hex-dump=<number>\n"));
- fprintf (stderr, _(" Dump the contents of section <number>\n"));
+ fprintf (stdout, _("Usage: readelf {options} elf-file(s)\n"));
+ fprintf (stdout, _(" Options are:\n"));
+ fprintf (stdout, _(" -a or --all Display all the information\n"));
+ fprintf (stdout, _(" -h or --file-header Display the ELF file header\n"));
+ fprintf (stdout, _(" -l or --program-headers or --segments\n"));
+ fprintf (stdout, _(" Display the program headers\n"));
+ fprintf (stdout, _(" -S or --sections Display the sections' headers\n"));
+ fprintf (stdout, _(" -s or --symbols Display the symbol table\n"));
+ fprintf (stdout, _(" -r or --relocs Display the relocations (if present)\n"));
+ fprintf (stdout, _(" -d or --dynamic Display the dynamic section (if present)\n"));
+ fprintf (stdout, _(" -V or --version-info Display the version sections (if present)\n"));
+ fprintf (stdout, _(" -D or --use-dynamic Use the dynamic section info when displaying symbols\n"));
+ fprintf (stdout, _(" -x <number> or --hex-dump=<number>\n"));
+ fprintf (stdout, _(" Dump the contents of section <number>\n"));
#ifdef SUPPORT_DISASSEMBLY
- fprintf (stderr, _(" -i <number> or --instruction-dump=<number>\n"));
- fprintf (stderr, _(" Disassemble the contents of section <number>\n"));
+ fprintf (stdout, _(" -i <number> or --instruction-dump=<number>\n"));
+ fprintf (stdout, _(" Disassemble the contents of section <number>\n"));
#endif
- fprintf (stderr, _(" -v or --version Display the version number of readelf\n"));
- fprintf (stderr, _(" -H or --help Display this information\n"));
+ fprintf (stdout, _(" -v or --version Display the version number of readelf\n"));
+ fprintf (stdout, _(" -H or --help Display this information\n"));
+ fprintf (stdout, _("Report bugs to bug-gnu-utils@gnu.org\n"));
exit (0);
}
@@ -1044,8 +1046,8 @@ parse_args (argc, argv)
int argc;
char ** argv;
{
- char c;
-
+ int c;
+
if (argc < 2)
usage ();
@@ -1131,7 +1133,10 @@ parse_args (argc, argv)
&& !do_load && !do_header && !do_dump && !do_version)
usage ();
else if (argc < 3)
- warn (_("Nothing to do.\n"));
+ {
+ warn (_("Nothing to do.\n"));
+ usage();
+ }
}
static int