This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Object dump problem for H8/300 target : "adds" ,"subs" problem


Hi Richard,

Sorry for late reply. 
It seems there is still one problem, Object dump is not generated properly 
with "adds" and "subs" instructions.
Following is the example,

foo.c
***************************
foo()
{
int a;
}
***************************

h8300-elf-gcc -c -o foo.o foo.c
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,@-r7
   2:	0d 76       	0d 76             mov.w	r7,r6
   4:	1b 87       	1b 87             subs	#2,er7
   6:	0d 20       	0d 20             mov.w	r2,r0
   8:	0b 87       	0b 87             adds	#2,er7
   a:	6d 76       	6d 76             mov.w	@r7+,r6
   c:	54 70       	54 70             rts	
***********************************************************

The problem is for h8300 target, object dump shows "er7" instead of "r7".
But previous problem is solved ( "e7" instead of "r7").

Above problem is observed on both mainline & branch.
I am using binutils-030711.

Regards,
Anil


-----Original Message-----
From: Anil Paranjape 
Sent: Friday, July 11, 2003 12:25 PM
To: 'Richard Sandiford'
Cc: binutils@sources.redhat.com
Subject: RE: Object dump problem for H8/300 target : problem solved


Hi Richard,

Objdump problem is tested for H8/300 target using snapshot from binutils.
It is working fine now.

Thanks for your mail.

Warm Regards,
Anil

-----Original Message-----
From: Richard Sandiford [mailto:rsandifo@redhat.com]
Sent: Tuesday, July 08, 2003 3:21 PM
To: Anil Paranjape
Cc: binutils@sources.redhat.com
Subject: Re: Object dump problem for H8/300 target


"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)
 			  {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]