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]

gas and objdump 2.14 i686 bugs


Hi,

I'm testing on i686-pc-linux-gnu (Red Hat 8.0, gcc 3.2-7) and I am
using as and objdump from the binutils 2.14 release, configured with
--enable-64-bit-bfd.

Given the following test case:
------------------------------------------------------------------------------
65 zion> cat foo.s
.intel_syntax noprefix
.text
fld xword ptr [esp-24]
fstp xword ptr [esp-24]
------------------------------------------------------------------------------

I observe the following anomalous behavior when I assemble it and
disassemble the result:

------------------------------------------------------------------------------
66 zion> as -o foo.o foo.s
67 zion> objdump -d -mi386:intel foo.o

foo.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:   d9 44 24 e8             fld    DWORD PTR [rsp-24]
   4:   d9 5c 24 e8             fstp   DWORD PTR [rsp-24]
------------------------------------------------------------------------------

1) The DWORD PTRs should be XWORD PTRs. The bytes should be (db 6c 24 e8)
and (db 7c 24 e8) respectively. I think this is a bug in gas. This leads to
inaccuracies in floating point calculations.

2) RSP should be ESP.  On another machine I have with objdump 2.11.93.0.2
20020207, we get ESP instead of RSP.  I assume that RSP is an x86_64 register;
I don't know how to tell objdump I am not interested in x86_64 stuff.

I haven't taken the time to try to find out what causes these.  If I
can do anything to help, please let me know; however, I don't yet
have a good working knowledge of the innards of the i386 assembler.

-Brian Gaeke
 U. of Illinois

P.S. In case you're wondering, the reason we configured with
--enable-64-bit-bfd is that objdump --disassemble-all on big files
tends to crash, when OP_OFF64() tries to call get64(), which aborts. (We
observed this behavior with Red Hat 8.0's system assembler, which claims
to be objdump version 2.13.90.0.2 20020802.) I was thinking that maybe
--enable-64-bit-bfd should be the default for i*86 targets.

P.P.S. For comparison purposes, here is the AT&T-syntax (blech) 
disassembly of the same .o file:
------------------------------------------------------------------------------
79 zion> objdump -d foo.o

foo.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:   d9 44 24 e8             flds   0xffffffe8(%esp,1)
   4:   d9 5c 24 e8             fstps  0xffffffe8(%esp,1)
------------------------------------------------------------------------------


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