From bff3635b312638461e1292b9a3c0427ce7b727f9 Mon Sep 17 00:00:00 2001 From: ru Date: Sat, 28 Jun 2003 22:30:46 +0000 Subject: Synchronize usage() and SYNOPSIS, and fix them (flags are not optional here). Sort options. Print the file name on error. --- usr.bin/elfdump/elfdump.1 | 6 +++--- usr.bin/elfdump/elfdump.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/elfdump/elfdump.1 b/usr.bin/elfdump/elfdump.1 index f310cdb..c159c7d 100644 --- a/usr.bin/elfdump/elfdump.1 +++ b/usr.bin/elfdump/elfdump.1 @@ -34,7 +34,7 @@ files .Sh SYNOPSIS .Nm -.Op Fl a | cdeiGhnprs +.Fl a | cdeGhinprs .Op Fl w Ar file .Ar file .Sh DESCRIPTION @@ -55,12 +55,12 @@ Dump shared headers. Dump dynamic symbols. .It Fl e Dump ELF header. -.It Fl i -Dump the dynamic interpreter. .It Fl G Dump the GOT. .It Fl h Dump the hash values. +.It Fl i +Dump the dynamic interpreter. .It Fl n Dump note sections. .It Fl p diff --git a/usr.bin/elfdump/elfdump.c b/usr.bin/elfdump/elfdump.c index fd92c2d..89b24e9 100644 --- a/usr.bin/elfdump/elfdump.c +++ b/usr.bin/elfdump/elfdump.c @@ -441,7 +441,7 @@ main(int ac, char **av) usage(); if ((fd = open(*av, O_RDONLY)) < 0 || fstat(fd, &sb) < 0) - err(1, NULL); + err(1, "%s", *av); e = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (e == MAP_FAILED) err(1, NULL); @@ -1109,6 +1109,6 @@ elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member) void usage(void) { - fprintf(stderr, "usage: elfdump [-acdeiGhnprs] [-w file] filename\n"); + fprintf(stderr, "usage: elfdump -a | -cdeGhinprs [-w file] file\n"); exit(1); } -- cgit v1.1