public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Object dump problem for H8/300 target
@ 2003-06-24  4:52 Anil Paranjape
  2003-07-08  9:53 ` Richard Sandiford
  0 siblings, 1 reply; 2+ messages in thread
From: Anil Paranjape @ 2003-06-24  4:52 UTC (permalink / raw)
  To: binutils

Hi All,

I have found a bug in objdump utility for H8/300 target. 
My binutils version is 2.13.2.1, but same problem is also observed in binutils version 2.14 also.
Please find problem description as follows,

/********************************/
foo.s

; void foo()
; {
; }

foo:
        mov.w r6, @-r7
        mov.w r7, r6
        mov.w @r7+, r6
        rts
/********************************/

h8300-elf-as -o foo.o foo.s
h8300-elf-objdump -d foo.o > foo.dmp

Contents of foo.dmp are

/*********************************/
foo.o:     file format elf32-h8300

Disassembly of section .text:
00000000 <foo>:
   0:   6d f6           6d f6             mov.w r6,@-e7
   2:   0d 76           0d 76             mov.w r7,r6
   4:   6d 76           6d 76             mov.w @r7+,r6
   6:   54 70           54 70             rts
/********************************/

The problem is, dump file is showing "-e7" instead of "-r7".

Regards,
Anil

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Object dump problem for H8/300 target
  2003-06-24  4:52 Object dump problem for H8/300 target Anil Paranjape
@ 2003-07-08  9:53 ` Richard Sandiford
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Sandiford @ 2003-07-08  9:53 UTC (permalink / raw)
  To: Anil Paranjape; +Cc: binutils

"Anil Paranjape" <AnilP1@KPITCummins.com> writes:
> I have found a bug in objdump utility for H8/300 target. 
> My binutils version is 2.13.2.1, but same problem is also observed in binutils version 2.14 also.
> [...]
>    0:   6d f6           6d f6             mov.w r6,@-e7
> [...]
> The problem is, dump file is showing "-e7" instead of "-r7".

The attached patch should fix this for 2.14.  It's no longer
a problem on trunk.

Tested on h8300-elf, no regressions.  OK for branch?

Richard


	* h8300-dis.c (bfd_h8_disassemble): Mask off the high bit of rd and rd
	for INC and DEC operands.

Index: opcodes/h8300-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/h8300-dis.c,v
retrieving revision 1.12
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.12 h8300-dis.c
--- opcodes/h8300-dis.c	30 Nov 2002 08:39:46 -0000	1.12
+++ opcodes/h8300-dis.c	8 Jul 2003 09:35:20 -0000
@@ -348,11 +348,11 @@ bfd_h8_disassemble (addr, info, mode)
 			  }
 			else if (x & INC)
 			  {
-			    fprintf (stream, "@%s+", pregnames[rs]);
+			    fprintf (stream, "@%s+", pregnames[rs & 7]);
 			  }
 			else if (x & DEC)
 			  {
-			    fprintf (stream, "@-%s", pregnames[rd]);
+			    fprintf (stream, "@-%s", pregnames[rd & 7]);
 			  }
 			else if (x & IND)
 			  {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-08  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-24  4:52 Object dump problem for H8/300 target Anil Paranjape
2003-07-08  9:53 ` Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).