aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-06-16 02:24:36 +0000
committerNick Clifton <nickc@redhat.com>1999-06-16 02:24:36 +0000
commitdd92f6397700e5478ae02b7dfad416181d04ef22 (patch)
tree74e2b69ee93ec598cdf7d160d9ac43efcd37c34b /binutils
parent5ba624b0f4cd66a3a8ed5980aef3fcf14e0f49ca (diff)
downloadgdb-dd92f6397700e5478ae02b7dfad416181d04ef22.zip
gdb-dd92f6397700e5478ae02b7dfad416181d04ef22.tar.gz
gdb-dd92f6397700e5478ae02b7dfad416181d04ef22.tar.bz2
Add -M command line switch to objdump - text of switch is passed on to disassembler
Add support for register name set selection ot ARM disassembler.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog14
-rw-r--r--binutils/NEWS5
-rw-r--r--binutils/binutils.texi16
-rw-r--r--binutils/objdump.c14
4 files changed, 47 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index d3e1ba3..83feb18 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,17 @@
+1999-06-14 Nick Clifton <nickc@cygnus.com>
+
+ * objdump.c (disassembler_options): New variable.
+ (usage): Document new -M/--disassembler-options option.
+ (long_options): Add --disassembler-options.
+ (disassemble_data): Initialise disassembler_options field of
+ disassembler_info structure.
+ (main): Add parsing of -M option.
+
+ * binutils.texi: Document new command line switch to objdump.
+
+ * NEWS: Describe new command line switch to objdump.
+
+
Mon Jun 14 10:27:54 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* binutils.texi: Fix typos.
diff --git a/binutils/NEWS b/binutils/NEWS
index 7c39501..eb27ad5 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -2,6 +2,11 @@
Changes in binutils 2.10:
+* New command line switch to objdump -M (or --disassembler-options) which takes
+ a parameter which can then be interpreted on a per-target basis by the
+ disassembler. Used by ARM targets to select register name sets, ISA, APCS or
+ raw verions.
+
* objdump support for -mi386:intel which causes disassembly to be displayed
with intel syntax.
diff --git a/binutils/binutils.texi b/binutils/binutils.texi
index 73bba55..535df3f 100644
--- a/binutils/binutils.texi
+++ b/binutils/binutils.texi
@@ -1137,6 +1137,7 @@ objdump [ -a | --archive-headers ]
[ -j @var{section} | --section=@var{section} ]
[ -l | --line-numbers ] [ -S | --source ]
[ -m @var{machine} | --architecture=@var{machine} ]
+ [ -M @var{options} | --disassembler-options=@var{options}]
[ -p | --private-headers ]
[ -r | --reloc ] [ -R | --dynamic-reloc ]
[ -s | --full-contents ] [ --stabs ]
@@ -1295,6 +1296,21 @@ can be useful when disassembling object files which do not describe
architecture information, such as S-records. You can list the available
architectures with the @samp{-i} option.
+@item -M @var{options}
+@itemx --disassembler-options=@var{options}
+Pass target specific information to the disassembler. Only supported on
+some targets.
+
+If the target is an ARM architecture then this switch can be used to
+select which register name set is used during disassembler. Specifying
+@samp{--disassembler-options=reg-name-std} (the default) will select the
+register names as used in ARM's instruction set documentation, but with
+register 13 called 'sp', register 14 called 'lr' and register 15 called
+'pc'. Specifying @samp{--disassembler-options=reg-names-apcs} will
+select the name set used by the ARM Procedure Call Standard, whilst
+specifying @samp{--disassembler-options=reg-names-raw} will just use
+@samp{r} followed by the register number.
+
@item -p
@itemx --private-headers
Print information that is specific to the object file format. The exact
diff --git a/binutils/objdump.c b/binutils/objdump.c
index 40c68cc..b7ee5d6 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -83,6 +83,9 @@ struct objdump_disasm_info {
/* Architecture to disassemble for, or default if NULL. */
static char *machine = (char *) NULL;
+/* Target specific options to the disassembler. */
+static char *disassembler_options = (char *) NULL;
+
/* Endianness to disassemble for, or default if BFD_ENDIAN_UNKNOWN. */
static enum bfd_endian endian = BFD_ENDIAN_UNKNOWN;
@@ -217,7 +220,8 @@ usage (stream, status)
int status;
{
fprintf (stream, _("\
-Usage: %s [-ahifCdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
+Usage: %s [-ahifCdDprRtTxsSlw] [-b bfdname] [-m machine] \n\
+ [-j section-name] [-M disassembler-options]\n\
[--archive-headers] [--target=bfdname] [--debugging] [--disassemble]\n\
[--disassemble-all] [--disassemble-zeroes] [--file-headers]\n\
[--section-headers] [--headers]\n\
@@ -255,6 +259,7 @@ static struct option long_options[]=
{"demangle", no_argument, &do_demangle, 1},
{"disassemble", no_argument, NULL, 'd'},
{"disassemble-all", no_argument, NULL, 'D'},
+ {"disassembler-options", required_argument, NULL, 'M'},
{"disassemble-zeroes", no_argument, &disassemble_zeroes, 1},
{"dynamic-reloc", no_argument, NULL, 'R'},
{"dynamic-syms", no_argument, NULL, 'T'},
@@ -1564,6 +1569,8 @@ disassemble_data (abfd)
disasm_info.flavour = bfd_get_flavour (abfd);
disasm_info.arch = bfd_get_arch (abfd);
disasm_info.mach = bfd_get_mach (abfd);
+ disasm_info.disassembler_options = disassembler_options;
+
if (bfd_big_endian (abfd))
disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG;
else if (bfd_little_endian (abfd))
@@ -2694,7 +2701,7 @@ main (argc, argv)
bfd_init ();
set_default_bfd_target ();
- while ((c = getopt_long (argc, argv, "pib:m:VCdDlfahrRtTxsSj:wE:",
+ while ((c = getopt_long (argc, argv, "pib:m:M:VCdDlfahrRtTxsSj:wE:",
long_options, (int *) 0))
!= EOF)
{
@@ -2707,6 +2714,9 @@ main (argc, argv)
case 'm':
machine = optarg;
break;
+ case 'M':
+ disassembler_options = optarg;
+ break;
case 'j':
only = optarg;
break;