bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/18770] New: Does not allow 32-bit address in 64-bit mode for me


From: m at rolle dot name
Subject: [Bug gas/18770] New: Does not allow 32-bit address in 64-bit mode for memory operand of i386 BNDMOV, etc.
Date: Tue, 04 Aug 2015 20:47:50 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=18770

            Bug ID: 18770
           Summary: Does not allow 32-bit address in 64-bit mode for
                    memory operand of i386 BNDMOV, etc.
           Product: binutils
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: m at rolle dot name
  Target Milestone: ---

I did not indicate Critical only because gas does not produce incorrect code. 
However, the bug is a serious one because gas will reject a valid instruction.

In BNDMOV and a few other similar instructions, one of the operands may be
located in memory.  There is NO restriction as to whether 32 or 64 bit
addresses are allowed.  #UD will occur with 16 bit addresses (which can't
happen in 64-bit mode anyway).

When I try to assemble
    bndmov [eax], bnd1
I get the message
    Error: 32-bit address isn't allowed in 64-bit MPX instructions.

Likewise with
    bndmk bnd1, [eax+16]

I think the programmers got confused about 32- and 64-bit addresses.  These
apply only to the contents of the bound registers themselves (i.e., bnd1 in the
above example).  Instructions like BNDMK load the register with a 32 or 64 bit
address, depending on the processor mode.  But even in these cases, a 32 bit
address can be used in 64 bit mode, and will just be zero-extended to 64 bits.

A similar problem exists with objdump disassembly, which is being filed as a
separate bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]