* vax quad.exp testsuite failure
@ 2001-02-08 19:53 John David Anglin
0 siblings, 0 replies; 5+ messages in thread
From: John David Anglin @ 2001-02-08 19:53 UTC (permalink / raw)
To: binutils, bug-binutils
The following failure occurs with the cvs source from 20010202 under vax-ultrix:
Running /xxx/gnu/binutils-2.10.91/gas/testsuite/gas/vax/quad.exp ...
GAS LISTING /xxx/gnu/binutils-2.10.91/gas/testsuite/gas/vax/quad.s
page 1
1 .text
2 0000 7D8F7856 movq $0xaabbccdd12345678,r0
2 3412DDCC
2 BBAA50
FAIL: quad.s: quadword immediate values
The expected value for the last line is:
2 BBAA5001
My first impression is that the expected test result is wrong (ie, the
last '01' is incorrect) and the listing output is ok. However, in testing,
I noted that the native vax as pads the file in the following manner:
bash-2.04# /usr/bin/as -o quad.o quad.s
bash-2.04# /usr/bin/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 0050 0004 0000
0000060
Here is a dump of the gas generated file:
bash-2.04# ../../../../objdir/gas/as-new -o quad.o quad.s
bash-2.04# /usr/bin/od -x quad.o
0000000 0107 0000 000b 0000 0000 0000 0000 0000
0000020 0000 0000 0000 0000 0000 0000 0000 0000
0000040 8f7d 5678 1234 ccdd aabb 0050
0000053
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.
Thus, there appear to be issues with the padding of the text section
and the disassembly of instructions at the end of the text section.
The native vax assembler appears to pad the text section so that the
data section is aligned to a 4 byte boundary.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <no.id>]
* Re: vax quad.exp testsuite failure
[not found] <no.id>
@ 2001-03-14 15:52 ` John David Anglin
2001-03-15 3:05 ` Alan Modra
2001-03-14 16:06 ` John David Anglin
1 sibling, 1 reply; 5+ messages in thread
From: John David Anglin @ 2001-03-14 15:52 UTC (permalink / raw)
To: John David Anglin; +Cc: binutils, bug-binutils
> 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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vax quad.exp testsuite failure
2001-03-14 15:52 ` John David Anglin
@ 2001-03-15 3:05 ` Alan Modra
2001-03-15 8:15 ` John David Anglin
0 siblings, 1 reply; 5+ messages in thread
From: Alan Modra @ 2001-03-15 3:05 UTC (permalink / raw)
To: John David Anglin; +Cc: binutils
On Wed, 14 Mar 2001, John David Anglin wrote:
> Here is a fix to correct the disassembly of quad.o by objdump.
Can I suggest taking a look at the way the i386-dis.c does this?
The reason being that your patch only catches one place where
FETCH_DATA can fail. What about NEXTWORD, NEXTLONG?
Alan Modra
--
Linuxcare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vax quad.exp testsuite failure
2001-03-15 3:05 ` Alan Modra
@ 2001-03-15 8:15 ` John David Anglin
0 siblings, 0 replies; 5+ messages in thread
From: John David Anglin @ 2001-03-15 8:15 UTC (permalink / raw)
To: Alan Modra; +Cc: binutils
> On Wed, 14 Mar 2001, John David Anglin wrote:
>
> > Here is a fix to correct the disassembly of quad.o by objdump.
>
> Can I suggest taking a look at the way the i386-dis.c does this?
> The reason being that your patch only catches one place where
> FETCH_DATA can fail. What about NEXTWORD, NEXTLONG?
I can't do this for a couple of weeks. However, the problem
may only occur reading the opcode. After that if the insn has
argument data, the length to fetch should be determined by the
mode for each operand.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: vax quad.exp testsuite failure
[not found] <no.id>
2001-03-14 15:52 ` John David Anglin
@ 2001-03-14 16:06 ` John David Anglin
1 sibling, 0 replies; 5+ messages in thread
From: John David Anglin @ 2001-03-14 16:06 UTC (permalink / raw)
To: John David Anglin; +Cc: binutils
> The following failure occurs with the cvs source from 20010202 under vax-ultrix:
>
> Running /xxx/gnu/binutils-2.10.91/gas/testsuite/gas/vax/quad.exp ...
> GAS LISTING /xxx/gnu/binutils-2.10.91/gas/testsuite/gas/vax/quad.s
> page 1
>
>
> 1 .text
> 2 0000 7D8F7856 movq $0xaabbccdd12345678,r0
> 2 3412DDCC
> 2 BBAA50
> FAIL: quad.s: quadword immediate values
This patch fixes the expected test result.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-01-14 John David Anglin <dave@hiauly1.hia.nrc.ca>
* gas/vax/quad.exp: Correct expected result.
--- gas/vax/quad.exp.orig Mon May 3 03:28:53 1999
+++ gas/vax/quad.exp Wed Mar 14 16:30:48 2001
@@ -8,7 +8,7 @@
expect {
-re "^ +2\[ \t\]+0000+ 7D8F7856\[ \t\]+movq\[^\n\]*\n" { set x1 1 }
-re "^ +2\[ \t\]+3412DDCC\[^\n\]*\n" { set x2 1 }
- -re "^ +2\[ \t\]+BBAA5001\[ \t\]*\r\n" { set x3 1 }
+ -re "^ +2\[ \t\]+BBAA50\[ \t\]*\r\n" { set x3 1 }
-re "\[^\n\]*\n" { }
timeout { perror "timeout\n"; break }
eof { break }
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-03-15 8:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-08 19:53 vax quad.exp testsuite failure John David Anglin
[not found] <no.id>
2001-03-14 15:52 ` John David Anglin
2001-03-15 3:05 ` Alan Modra
2001-03-15 8:15 ` John David Anglin
2001-03-14 16:06 ` John David Anglin
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).