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]

Re: vax quad.exp testsuite failure


> Note the different file offsets for the data section.  Also, if I add a
> `nop' to the test, objdump doesn't print it:
> 
> bash-2.04# ../../../../objdir/gas/as-new -o quad.o quad.s
> bash-2.04# od -x quad.o
> 0000000 0107 0000 000c 0000 0000 0000 0000 0000
> 0000020 0000 0000 0000 0000 0000 0000 0000 0000
> 0000040 8f7d 5678 1234 ccdd aabb 0150
> 0000054
> bash-2.04# ../../../../objdir/binutils/objdump -hd quad.o
> 
> quad.o:     file format a.out
> 
> Sections:
> Idx Name          Size      VMA       LMA       File off  Algn
>   0 .text         0000000c  00000000  00000000  00000020  2**2
> 		  CONTENTS, ALLOC, LOAD, CODE
>   1 .data         00000000  0000000c  0000000c  0000002c  2**2
> 		  CONTENTS, ALLOC, LOAD, DATA
>   2 .bss          00000000  0000000c  0000000c  00000000  2**2
> 		  ALLOC
> ../../../../objdir/binutils/objdump: quad.o: no symbols
> Disassembly of section .text:
> 
> 00000000 <.text>:
>    0:   7d 8f 78 56     movq $0xaabbccdd12345678,r0
>    4:   34 12 dd cc
>    8:   bb aa 50
>    b:   Address 0xb is out of bounds.

Here is a fix to correct the disassembly of quad.o by objdump.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2001-03-14  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* vax-dis.c (print_insn_vax): Only fetch two bytes if the info buffer
	has more than one byte left to read.

--- vax-dis.c.orig	Fri Apr 14 00:16:58 2000
+++ vax-dis.c	Wed Mar 14 17:40:45 2001
@@ -126,7 +126,18 @@
       return -1;
     }
 
-  FETCH_DATA (info, buffer + 2);
+  /* Check if the info buffer has more than one byte left since
+     the last opcode might be a single byte with no argument data.  */
+  if (info->buffer_length - (memaddr - info->buffer_vma) > 1)
+    {
+      FETCH_DATA (info, buffer + 2);
+    }
+  else
+    {
+      FETCH_DATA (info, buffer + 1);
+      buffer[1] = 0;
+    }
+
   for (votp = &votstrs[0]; votp->name[0]; votp++)
     {
       register vax_opcodeT opcode = votp->detail.code;


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