/* objdump.c -- dump information about an object file.
- Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of GNU Binutils.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
-#include "sysdep.h"
#include "getopt.h"
#include "progress.h"
#include "bucomm.h"
-#include <stdio.h>
#include <ctype.h>
#include "dis-asm.h"
#include "libiberty.h"
+#include "debug.h"
+#include "budbg.h"
/* Internal headers for the ELF .stab-dump code - sorry. */
#define BYTES_IN_WORD 32
#include "aout/aout64.h"
-#ifndef FPRINTF_ALREADY_DECLARED
-extern int fprintf PARAMS ((FILE *, CONST char *, ...));
+#ifdef NEED_DECLARATION_FPRINTF
+/* This is needed by INIT_DISASSEMBLE_INFO. */
+extern int fprintf ();
#endif
char *default_target = NULL; /* default at runtime */
int dump_reloc_info; /* -r */
int dump_dynamic_reloc_info; /* -R */
int dump_ar_hdrs; /* -a */
+int dump_private_headers; /* -p */
int with_line_numbers; /* -l */
boolean with_source_code; /* -S */
+int show_raw_insn; /* --show-raw-insn */
int dump_stab_section_info; /* --stabs */
boolean disassemble; /* -d */
boolean disassemble_all; /* -D */
boolean formats_info; /* -i */
char *only; /* -j secname */
+int wide_output; /* -w */
+bfd_vma start_address = (bfd_vma) -1; /* --start-address */
+bfd_vma stop_address = (bfd_vma) -1; /* --stop-address */
+int dump_debugging; /* --debugging */
/* Extra info to pass to the disassembler address printing function. */
struct objdump_disasm_info {
static void
display_bfd PARAMS ((bfd *abfd));
+static void
+objdump_print_value PARAMS ((bfd_vma, FILE *));
+
static void
objdump_print_address PARAMS ((bfd_vma, struct disassemble_info *));
static void
show_line PARAMS ((bfd *, asection *, bfd_vma));
+
+static const char *
+endian_string PARAMS ((enum bfd_endian));
\f
void
usage (stream, status)
int status;
{
fprintf (stream, "\
-Usage: %s [-ahifdDrRtTxsSl] [-b bfdname] [-m machine] [-j section-name]\n\
- [--archive-headers] [--target=bfdname] [--disassemble]\n\
+Usage: %s [-ahifdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
+ [--archive-headers] [--target=bfdname] [--debugging] [--disassemble]\n\
[--disassemble-all] [--file-headers] [--section-headers] [--headers]\n\
- [--info] [--section=section-name] [--line-numbers] [--source]\n\
+ [--info] [--section=section-name] [--line-numbers] [--source]\n",
+ program_name);
+ fprintf (stream, "\
[--architecture=machine] [--reloc] [--full-contents] [--stabs]\n\
[--syms] [--all-headers] [--dynamic-syms] [--dynamic-reloc]\n\
- [--version] [--help] objfile...\n\
-at least one option besides -l (--line-numbers) must be given\n",
- program_name);
+ [--wide] [--version] [--help] [--private-headers]\n\
+ [--start-address=addr] [--stop-address=addr]\n\
+ [--show-raw-insn] objfile...\n\
+at least one option besides -l (--line-numbers) must be given\n");
list_supported_targets (program_name, stream);
exit (status);
}
+/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
+
+#define OPTION_START_ADDRESS (150)
+#define OPTION_STOP_ADDRESS (OPTION_START_ADDRESS + 1)
+
static struct option long_options[]=
{
{"all-headers", no_argument, NULL, 'x'},
+ {"private-headers", no_argument, NULL, 'p'},
{"architecture", required_argument, NULL, 'm'},
{"archive-headers", no_argument, NULL, 'a'},
+ {"debugging", no_argument, &dump_debugging, 1},
{"disassemble", no_argument, NULL, 'd'},
{"disassemble-all", no_argument, NULL, 'D'},
{"dynamic-reloc", no_argument, NULL, 'R'},
{"reloc", no_argument, NULL, 'r'},
{"section", required_argument, NULL, 'j'},
{"section-headers", no_argument, NULL, 'h'},
+ {"show-raw-insn", no_argument, &show_raw_insn, 1},
{"source", no_argument, NULL, 'S'},
{"stabs", no_argument, &dump_stab_section_info, 1},
+ {"start-address", required_argument, NULL, OPTION_START_ADDRESS},
+ {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS},
{"syms", no_argument, NULL, 't'},
{"target", required_argument, NULL, 'b'},
- {"version", no_argument, &show_version, 1},
+ {"version", no_argument, &show_version, 1},
+ {"wide", no_argument, &wide_output, 'w'},
{0, no_argument, 0, 0}
};
\f
(unsigned) bfd_get_section_size_before_reloc (section));
printf (" vma ");
printf_vma (section->vma);
- printf (" align 2**%u\n ",
- section->alignment_power);
+ printf (" lma ");
+ printf_vma (section->lma);
+ printf (" align 2**%u%s ",
+ section->alignment_power, (wide_output) ? "" : "\n");
PF (SEC_ALLOC, "ALLOC");
PF (SEC_CONSTRUCTOR, "CONSTRUCTOR");
PF (SEC_CONSTRUCTOR_TEXT, "CONSTRUCTOR TEXT");
PF (SEC_ROM, "ROM");
PF (SEC_DEBUGGING, "DEBUGGING");
PF (SEC_NEVER_LOAD, "NEVER_LOAD");
+ PF (SEC_EXCLUDE, "EXCLUDE");
+ PF (SEC_SORT_ENTRIES, "SORT ENTRIES");
printf ("\n");
#undef PF
}
if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
{
printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd));
+ symcount = 0;
return NULL;
}
{
fprintf (stderr, "%s: %s: not a dynamic object\n",
program_name, bfd_get_filename (abfd));
+ dynsymcount = 0;
return NULL;
}
return out_ptr - symbols;
}
-/* Sort symbols into value order. */
+/* Sort symbols into value order. */
static int
compare_symbols (ap, bp)
{
const asymbol *a = *(const asymbol **)ap;
const asymbol *b = *(const asymbol **)bp;
+ const char *an, *bn;
+ size_t anl, bnl;
+ boolean af, bf;
+ flagword aflags, bflags;
if (bfd_asymbol_value (a) > bfd_asymbol_value (b))
return 1;
return 1;
else if (a->section < b->section)
return -1;
+
+ an = bfd_asymbol_name (a);
+ bn = bfd_asymbol_name (b);
+ anl = strlen (an);
+ bnl = strlen (bn);
+
+ /* The symbols gnu_compiled and gcc2_compiled convey no real
+ information, so put them after other symbols with the same value. */
+
+ af = (strstr (an, "gnu_compiled") != NULL
+ || strstr (an, "gcc2_compiled") != NULL);
+ bf = (strstr (bn, "gnu_compiled") != NULL
+ || strstr (bn, "gcc2_compiled") != NULL);
+
+ if (af && ! bf)
+ return 1;
+ if (! af && bf)
+ return -1;
+
+ /* We use a heuristic for the file name, to try to sort it after
+ more useful symbols. It may not work on non Unix systems, but it
+ doesn't really matter; the only difference is precisely which
+ symbol names get printed. */
+
+#define file_symbol(s, sn, snl) \
+ (((s)->flags & BSF_FILE) != 0 \
+ || ((sn)[(snl) - 2] == '.' \
+ && ((sn)[(snl) - 1] == 'o' \
+ || (sn)[(snl) - 1] == 'a')))
+
+ af = file_symbol (a, an, anl);
+ bf = file_symbol (b, bn, bnl);
+
+ if (af && ! bf)
+ return 1;
+ if (! af && bf)
+ return -1;
+
+ /* Finally, try to sort global symbols before local symbols before
+ debugging symbols. */
+
+ aflags = a->flags;
+ bflags = b->flags;
+
+ if ((aflags & BSF_DEBUGGING) != (bflags & BSF_DEBUGGING))
+ {
+ if ((aflags & BSF_DEBUGGING) != 0)
+ return 1;
+ else
+ return -1;
+ }
+ if ((aflags & BSF_LOCAL) != (bflags & BSF_LOCAL))
+ {
+ if ((aflags & BSF_LOCAL) != 0)
+ return 1;
+ else
+ return -1;
+ }
+
return 0;
}
else if (a->address < b->address)
return -1;
- return compare_symbols ((const PTR) a->sym_ptr_ptr,
- (const PTR) b->sym_ptr_ptr);
+ /* So that associated relocations tied to the same address show up
+ in the correct order, we don't do any further sorting. */
+ if (a > b)
+ return 1;
+ else if (a < b)
+ return -1;
+ else
+ return 0;
+}
+
+/* Print VMA to STREAM with no leading zeroes. */
+
+static void
+objdump_print_value (vma, stream)
+ bfd_vma vma;
+ FILE *stream;
+{
+ char buf[30];
+ char *p;
+
+ sprintf_vma (buf, vma);
+ for (p = buf; *p == '0'; ++p)
+ ;
+ fprintf (stream, "%s", p);
}
/* Print VMA symbolically to INFO if possible. */
bfd_vma vma;
struct disassemble_info *info;
{
- /* @@ For relocateable files, should filter out symbols belonging to
- the wrong section. Unfortunately, not enough information is supplied
- to this routine to determine the correct section in all cases. */
/* @@ Would it speed things up to cache the last two symbols returned,
and maybe their address ranges? For many processors, only one memory
operand can be present at a time, so the 2-entry cache wouldn't be
long max = sorted_symcount;
long thisplace;
- bfd_signed_vma vardiff;
-
fprintf_vma (info->stream, vma);
if (sorted_symcount < 1)
thisplace = (max + min) / 2;
sym = sorted_syms[thisplace];
- vardiff = bfd_asymbol_value (sym) - vma;
-
- if (vardiff > 0)
+ if (bfd_asymbol_value (sym) > vma)
max = thisplace;
- else if (vardiff < 0)
+ else if (bfd_asymbol_value (sym) < vma)
min = thisplace;
else
{
}
/* The symbol we want is now in min, the low end of the range we
- were searching. */
+ were searching. If there are several symbols with the same
+ value, we want the first one. */
thisplace = min;
+ while (thisplace > 0
+ && (bfd_asymbol_value (sorted_syms[thisplace])
+ == bfd_asymbol_value (sorted_syms[thisplace - 1])))
+ --thisplace;
- {
- /* If this symbol isn't global, search for one with the same value
- that is. */
- bfd_vma val = bfd_asymbol_value (sorted_syms[thisplace]);
- long i;
- if (sorted_syms[thisplace]->flags & (BSF_LOCAL|BSF_DEBUGGING))
- for (i = thisplace - 1; i >= 0; i--)
- {
- if (bfd_asymbol_value (sorted_syms[i]) == val
- && (!(sorted_syms[i]->flags & (BSF_LOCAL|BSF_DEBUGGING))
- || ((sorted_syms[thisplace]->flags & BSF_DEBUGGING)
- && !(sorted_syms[i]->flags & BSF_DEBUGGING))))
- {
- thisplace = i;
- break;
- }
- }
- if (sorted_syms[thisplace]->flags & (BSF_LOCAL|BSF_DEBUGGING))
- for (i = thisplace + 1; i < sorted_symcount; i++)
- {
- if (bfd_asymbol_value (sorted_syms[i]) == val
- && (!(sorted_syms[i]->flags & (BSF_LOCAL|BSF_DEBUGGING))
- || ((sorted_syms[thisplace]->flags & BSF_DEBUGGING)
- && !(sorted_syms[i]->flags & BSF_DEBUGGING))))
- {
- thisplace = i;
- break;
- }
- }
- }
{
/* If the file is relocateable, and the symbol could be from this
section, prefer a symbol from this section over symbols from
|| ((aux->abfd->flags & HAS_RELOC) != 0
&& vma >= bfd_get_section_vma (aux->abfd, aux->sec)
&& vma < (bfd_get_section_vma (aux->abfd, aux->sec)
- + bfd_get_section_size_before_reloc (aux->sec)))))
+ + bfd_section_size (aux->abfd, aux->sec)))))
{
for (i = thisplace + 1; i < sorted_symcount; i++)
{
--i;
for (; i >= 0; i--)
{
- if (sorted_syms[i]->section == aux->sec)
+ if (sorted_syms[i]->section == aux->sec
+ && (i == 0
+ || sorted_syms[i - 1]->section != aux->sec
+ || (bfd_asymbol_value (sorted_syms[i])
+ != bfd_asymbol_value (sorted_syms[i - 1]))))
{
thisplace = i;
break;
}
}
}
+
+ if (sorted_syms[thisplace]->section != aux->sec
+ && (aux->require_sec
+ || ((aux->abfd->flags & HAS_RELOC) != 0
+ && vma >= bfd_get_section_vma (aux->abfd, aux->sec)
+ && vma < (bfd_get_section_vma (aux->abfd, aux->sec)
+ + bfd_section_size (aux->abfd, aux->sec)))))
+ {
+ bfd_vma secaddr;
+
+ fprintf (info->stream, " <%s",
+ bfd_get_section_name (aux->abfd, aux->sec));
+ secaddr = bfd_get_section_vma (aux->abfd, aux->sec);
+ if (vma < secaddr)
+ {
+ fprintf (info->stream, "-");
+ objdump_print_value (secaddr - vma, info->stream);
+ }
+ else if (vma > secaddr)
+ {
+ fprintf (info->stream, "+");
+ objdump_print_value (vma - secaddr, info->stream);
+ }
+ fprintf (info->stream, ">");
+ return;
+ }
}
}
fprintf (info->stream, " <%s", sorted_syms[thisplace]->name);
if (bfd_asymbol_value (sorted_syms[thisplace]) > vma)
{
- char buf[30], *p = buf;
- sprintf_vma (buf, bfd_asymbol_value (sorted_syms[thisplace]) - vma);
- while (*p == '0')
- p++;
- fprintf (info->stream, "-%s", p);
+ fprintf (info->stream, "-");
+ objdump_print_value (bfd_asymbol_value (sorted_syms[thisplace]) - vma,
+ info->stream);
}
else if (vma > bfd_asymbol_value (sorted_syms[thisplace]))
{
- char buf[30], *p = buf;
- sprintf_vma (buf, vma - bfd_asymbol_value (sorted_syms[thisplace]));
- while (*p == '0')
- p++;
- fprintf (info->stream, "+%s", p);
+ fprintf (info->stream, "+");
+ objdump_print_value (vma - bfd_asymbol_value (sorted_syms[thisplace]),
+ info->stream);
}
fprintf (info->stream, ">");
}
bfd *abfd;
{
long i;
- unsigned int (*print) () = 0; /* Old style */
disassembler_ftype disassemble_fn = 0; /* New style */
struct disassemble_info disasm_info;
struct objdump_disasm_info aux;
disasm_info.application_data = (PTR) &aux;
aux.abfd = abfd;
disasm_info.print_address_func = objdump_print_address;
+ if (show_raw_insn)
+ disasm_info.flags |= DISASM_RAW_INSN_FLAG;
if (machine != (char *) NULL)
{
- bfd_arch_info_type *info = bfd_scan_arch (machine);
+ const bfd_arch_info_type *info = bfd_scan_arch (machine);
if (info == NULL)
{
fprintf (stderr, "%s: Can't use supplied machine %s\n",
abfd->arch_info = info;
}
- /* See if we can disassemble using bfd. */
-
- if (abfd->arch_info->disassemble)
+ disassemble_fn = disassembler (abfd);
+ if (!disassemble_fn)
{
- print = abfd->arch_info->disassemble;
+ fprintf (stderr, "%s: Can't disassemble for architecture %s\n",
+ program_name,
+ bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
+ exit (1);
}
+
+ disasm_info.arch = bfd_get_arch (abfd);
+ disasm_info.mach = bfd_get_mach (abfd);
+ if (bfd_big_endian (abfd))
+ disasm_info.endian = BFD_ENDIAN_BIG;
+ else if (bfd_little_endian (abfd))
+ disasm_info.endian = BFD_ENDIAN_LITTLE;
else
- {
- disassemble_fn = disassembler (abfd);
- if (!disassemble_fn)
- {
- fprintf (stderr, "%s: Can't disassemble for architecture %s\n",
- program_name,
- bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
- exit (1);
- }
- }
+ /* ??? Aborting here seems too drastic. We could default to big or little
+ instead. */
+ disasm_info.endian = BFD_ENDIAN_UNKNOWN;
for (section = abfd->sections;
section != (asection *) NULL;
arelent **relbuf = NULL;
arelent **relpp = NULL;
arelent **relppend = NULL;
+ long stop;
if ((section->flags & SEC_LOAD) == 0
|| (! disassemble_all
disasm_info.buffer = data;
disasm_info.buffer_vma = section->vma;
disasm_info.buffer_length = datasize;
- i = 0;
- while (i < disasm_info.buffer_length)
+ if (start_address == (bfd_vma) -1
+ || start_address < disasm_info.buffer_vma)
+ i = 0;
+ else
+ i = start_address - disasm_info.buffer_vma;
+ if (stop_address == (bfd_vma) -1)
+ stop = datasize;
+ else
+ {
+ if (stop_address < disasm_info.buffer_vma)
+ stop = 0;
+ else
+ stop = stop_address - disasm_info.buffer_vma;
+ if (stop > disasm_info.buffer_length)
+ stop = disasm_info.buffer_length;
+ }
+ while (i < stop)
{
int bytes;
+ boolean need_nl = false;
if (data[i] == 0 && data[i + 1] == 0 && data[i + 2] == 0 &&
data[i + 3] == 0)
aux.require_sec = false;
putchar (' ');
- if (disassemble_fn)
- {
- /* New style */
- bytes = (*disassemble_fn) (section->vma + i, &disasm_info);
- if (bytes < 0)
- break;
- }
+ bytes = (*disassemble_fn) (section->vma + i, &disasm_info);
+ if (bytes < 0)
+ break;
+
+ if (!wide_output)
+ putchar ('\n');
else
- {
- /* Old style */
- bytes = print (section->vma + i, data + i, stdout);
- }
- putchar ('\n');
+ need_nl = true;
}
if (dump_reloc_info
&& (section->flags & SEC_RELOC) != 0)
{
while (relpp < relppend
- && ((*relpp)->address >= i
- && (*relpp)->address < i + bytes))
+ && ((*relpp)->address >= (bfd_vma) i
+ && (*relpp)->address < (bfd_vma) i + bytes))
{
arelent *q;
const char *sym_name;
}
printf ("\n");
-
+ need_nl = false;
++relpp;
}
}
+ if (need_nl)
+ printf ("\n");
+
i += bytes;
}
if (relbuf != NULL)
free (relbuf);
}
+ free (sorted_syms);
}
\f
char *stabsect_name;
char *strsect_name;
{
- if (read_section_stabs (abfd, stabsect_name, strsect_name))
+ asection *s;
+
+ /* Check for section names for which stabsect_name is a prefix, to
+ handle .stab0, etc. */
+ for (s = abfd->sections;
+ s != NULL;
+ s = s->next)
{
- print_section_stabs (abfd, stabsect_name, strsect_name);
- free (stabs);
- free (strtab);
+ if (strncmp (stabsect_name, s->name, strlen (stabsect_name)) == 0
+ && strncmp (strsect_name, s->name, strlen (strsect_name)) != 0)
+ {
+ if (read_section_stabs (abfd, s->name, strsect_name))
+ {
+ print_section_stabs (abfd, s->name, strsect_name);
+ free (stabs);
+ free (strtab);
+ }
+ }
}
}
\f
printf ("\nstart address 0x");
printf_vma (abfd->start_address);
}
-
+\f
+static void
+dump_bfd_private_header (abfd)
+bfd *abfd;
+{
+ bfd_print_private_bfd_data (abfd, stdout);
+}
static void
display_bfd (abfd)
bfd *abfd;
print_arelt_descr (stdout, abfd, true);
if (dump_file_header)
dump_bfd_header (abfd);
+ if (dump_private_headers)
+ dump_bfd_private_header (abfd);
putchar ('\n');
if (dump_section_headers)
dump_headers (abfd);
- if (dump_symtab || dump_reloc_info || disassemble)
+ if (dump_symtab || dump_reloc_info || disassemble || dump_debugging)
{
syms = slurp_symtab (abfd);
}
dump_data (abfd);
if (disassemble)
disassemble_data (abfd);
+ if (dump_debugging)
+ {
+ PTR dhandle;
+
+ dhandle = read_debugging_info (abfd, syms, symcount);
+ if (dhandle != NULL)
+ {
+ if (! print_debugging_info (stdout, dhandle))
+ fprintf (stderr, "%s: printing debugging information failed\n",
+ bfd_get_filename (abfd));
+ }
+ }
+ if (syms)
+ {
+ free (syms);
+ syms = NULL;
+ }
+ if (dynsyms)
+ {
+ free (dynsyms);
+ dynsyms = NULL;
+ }
}
static void
bfd_byte *data = 0;
bfd_size_type datasize = 0;
bfd_size_type i;
+ bfd_size_type start, stop;
for (section = abfd->sections; section != NULL; section =
section->next)
bfd_get_section_contents (abfd, section, (PTR) data, 0, bfd_section_size (abfd, section));
- for (i = 0; i < bfd_section_size (abfd, section); i += onaline)
+ if (start_address == (bfd_vma) -1
+ || start_address < section->vma)
+ start = 0;
+ else
+ start = start_address - section->vma;
+ if (stop_address == (bfd_vma) -1)
+ stop = bfd_section_size (abfd, section);
+ else
+ {
+ if (stop_address < section->vma)
+ stop = 0;
+ else
+ stop = stop_address - section->vma;
+ if (stop > bfd_section_size (abfd, section))
+ stop = bfd_section_size (abfd, section);
+ }
+ for (i = start; i < stop; i += onaline)
{
bfd_size_type j;
printf (" %04lx ", (unsigned long int) (i + section->vma));
for (j = i; j < i + onaline; j++)
{
- if (j < bfd_section_size (abfd, section))
+ if (j < stop)
printf ("%02x", (unsigned) (data[j]));
else
printf (" ");
printf (" ");
for (j = i; j < i + onaline; j++)
{
- if (j >= bfd_section_size (abfd, section))
+ if (j >= stop)
printf (" ");
else
printf ("%c", isprint (data[j]) ? data[j] : '.');
else if ((a->flags & SEC_RELOC) == 0)
continue;
- printf ("RELOCATION RECORDS FOR [%s]:", a->name);
-
relsize = bfd_get_reloc_upper_bound (abfd, a);
if (relsize < 0)
bfd_fatal (bfd_get_filename (abfd));
+ printf ("RELOCATION RECORDS FOR [%s]:", a->name);
+
if (relsize == 0)
{
printf (" (none)\n\n");
arelent **relpp;
long relcount;
- printf ("DYNAMIC RELOCATION RECORDS");
-
relsize = bfd_get_dynamic_reloc_upper_bound (abfd);
if (relsize < 0)
bfd_fatal (bfd_get_filename (abfd));
+ printf ("DYNAMIC RELOCATION RECORDS");
+
if (relsize == 0)
{
printf (" (none)\n\n");
CONST char *sym_name;
CONST char *section_name;
+ if (start_address != (bfd_vma) -1
+ && q->address < start_address)
+ continue;
+ if (stop_address != (bfd_vma) -1
+ && q->address > stop_address)
+ continue;
+
if (q->sym_ptr_ptr && *q->sym_ptr_ptr)
{
sym_name = (*(q->sym_ptr_ptr))->name;
#define L_tmpnam 25
#endif
+static const char *
+endian_string (endian)
+ enum bfd_endian endian;
+{
+ if (endian == BFD_ENDIAN_BIG)
+ return "big endian";
+ else if (endian == BFD_ENDIAN_LITTLE)
+ return "little endian";
+ else
+ return "endianness unknown";
+}
+
/* List the targets that BFD is configured to support, each followed
by its endianness and the architectures it supports. */
int a;
printf ("%s\n (header %s, data %s)\n", p->name,
- p->header_byteorder_big_p ? "big endian" : "little endian",
- p->byteorder_big_p ? "big endian" : "little endian");
+ endian_string (p->header_byteorder),
+ endian_string (p->byteorder));
if (abfd == NULL)
{
bfd_init ();
- while ((c = getopt_long (argc, argv, "ib:m:VdDlfahrRtTxsSj:", long_options,
+ while ((c = getopt_long (argc, argv, "pib:m:VdDlfahrRtTxsSj:w", long_options,
(int *) 0))
!= EOF)
{
- seenflag = true;
+ if (c != 'l' && c != OPTION_START_ADDRESS && c != OPTION_STOP_ADDRESS)
+ seenflag = true;
switch (c)
{
case 0:
case 'i':
formats_info = true;
break;
+ case 'p':
+ dump_private_headers = 1;
+ break;
case 'x':
+ dump_private_headers = 1;
dump_symtab = 1;
dump_reloc_info = 1;
dump_file_header = true;
case 'V':
show_version = 1;
break;
+ case 'w':
+ wide_output = 1;
+ break;
+ case OPTION_START_ADDRESS:
+ start_address = parse_vma (optarg, "--start-address");
+ break;
+ case OPTION_STOP_ADDRESS:
+ stop_address = parse_vma (optarg, "--stop-address");
+ break;
default:
usage (stderr, 1);
}