bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/31885] New: [GAS] Change register types


From: witbring at gmail dot com
Subject: [Bug gas/31885] New: [GAS] Change register types
Date: Wed, 12 Jun 2024 14:20:01 +0000

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

            Bug ID: 31885
           Summary: [GAS] Change register types
           Product: binutils
           Version: 2.41
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: witbring at gmail dot com
  Target Milestone: ---

I found that GAS 2.41 changes register types without any warning. 
I believe GAS should more accurately verify assembly syntax and issue warnings
if it alters register types.

I identified this issue with 9 opcodes in x64 binaries and 4 opcodes in x86
binaries.

# x64 binareis

```
.intel_syntax noprefix
Bug:
    lar RAX, RBX
    lsl RAX, WORD PTR [1]
    mov RAX, GS
    movmskpd RAX, XMM0       
    pmovmskb RAX, MM2
    sldt RAX
    str RAX
    verr RAX
    verr RAX                  
main:
    jmp Bug
```

Compiled Code
```
Bug:
 lar    eax,ebx
 lsl    eax,WORD PTR ds:0x1
 mov    eax,gs
 movmskpd eax,xmm0
 pmovmskb eax,mm2
 sldt   eax
 str    eax
 verr   eax
 verr   eax

```

# x86 binaries

Buggy code
```
.intel_syntax noprefix
Bug:
   ltr EAX
   lldt EAX
   verw ESP
   verw EDI
```

Compiled Code
```
Bug:
  ltr    ax
  lldt   ax
  verr   ax
  verw   ax
```

-- 
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]