bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/24821] New: Missing standalone prefix check


From: hjl.tools at gmail dot com
Subject: [Bug gas/24821] New: Missing standalone prefix check
Date: Wed, 17 Jul 2019 23:36:10 +0000

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

            Bug ID: 24821
           Summary: Missing standalone prefix check
           Product: binutils
           Version: 2.33 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i386

Prefixes aren't valid for all instructions:

[hjl@gnu-cfl-1 prefix-4]$ cat y.s 
        rep repz stosb
        rep movups (%rax), %xmm0
        bnd movups (%rax), %xmm0
[hjl@gnu-cfl-1 prefix-4]$ make y.o
./as  -o y.o y.s
y.s: Assembler messages:
y.s:1: Error: same type of prefix used twice
y.s:2: Error: invalid instruction `movups' after `rep'
y.s:3: Error: expecting valid branch instruction after `bnd'
make: *** [Makefile:17: y.o] Error 1
[hjl@gnu-cfl-1 prefix-4]$ 

But standalone prefix isn't checked against the instruction which
the prefix is applied on:

[hjl@gnu-cfl-1 prefix-4]$ cat x.s 
        .text
        rep
        repz stosb
        rep
        movups (%rax), %xmm0
        bnd
        movups (%rax), %xmm0
        rep
        .pushsection .foo,"ax",@progbits
        movups (%rax), %xmm0
        .popsection
        movups (%rax), %xmm1
        bnd
[hjl@gnu-cfl-1 prefix-4]$ ./as  -o x.o x.s
[hjl@gnu-cfl-1 prefix-4]$ objdump -dw x.o

x.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <.text>:
   0:   f3 f3 aa                repz rep stos %al,%es:(%rdi)
   3:   f3 0f 10 00             movss  (%rax),%xmm0
   7:   f2 0f 10 00             movsd  (%rax),%xmm0
   b:   f3 0f 10 08             movss  (%rax),%xmm1
   f:   f2                      repnz

Disassembly of section .foo:

0000000000000000 <.foo>:
   0:   0f 10 00                movups (%rax),%xmm0
[hjl@gnu-cfl-1 prefix-4]$

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