bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/32534] New: [GAS] Intel Assembly Bugs (Mishandle Labels)


From: witbring at gmail dot com
Subject: [Bug gas/32534] New: [GAS] Intel Assembly Bugs (Mishandle Labels)
Date: Thu, 09 Jan 2025 00:30:57 +0000

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

            Bug ID: 32534
           Summary: [GAS] Intel Assembly Bugs (Mishandle Labels)
           Product: binutils
           Version: 2.38
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: witbring at gmail dot com
  Target Milestone: ---

I am reporting GNU AS bug found during research.
The tests were conducted using the latest version (binutils 2.38).
The issue occurs in the same way with previous versions as well.

When some register names are used in operands, GAS interprets them as
actual registers. Notably, GAS allows the creation of these labels,
which could potentially lead to problems.


1. Example Code

```
.intel_syntax noprefix
.data
RAX:
RbX:
Rcx:
    .long 0
.text
test:
        mov     edx, DWORD PTR [RAX]
        mov     edx, DWORD PTR [RbX]
        mov     edx, DWORD PTR [Rcx]
    call rsP

rsP:
    ret
```

2. Compilation Command

```
gcc -c test.c
```

3. Compiled Binary Output

```
0000000000000000 <test>:
   0:   8b 10                   mov    edx,DWORD PTR [rax]
   2:   8b 13                   mov    edx,DWORD PTR [rbx]
   4:   8b 11                   mov    edx,DWORD PTR [rcx]
   6:   ff d4                   call   rsp

0000000000000008 <rsP>:
   8:   c3                      ret
```

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