bug-binutils
[Top][All Lists]
Advanced

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

[Bug gas/25789] [as] x86: duplicate jmp when .nops and jmp are used toge


From: hjl.tools at gmail dot com
Subject: [Bug gas/25789] [as] x86: duplicate jmp when .nops and jmp are used together
Date: Mon, 06 Apr 2020 12:12:19 +0000

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Gas limits number of executed NOP paddings to 7 NOPs:

[hjl@gnu-cfl-2 tmp]$ cat x.s
foo:
        ret
        .p2align 7
        mov %eax,%eax
[hjl@gnu-cfl-2 tmp]$ gcc -c x.s
[hjl@gnu-cfl-2 tmp]$ objdump -dw x.o

x.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   c3                      retq   
   1:   eb 7d                   jmp    80 <foo+0x80>
   3:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
   e:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  19:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  24:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  2f:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  3a:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  45:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  50:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  5b:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  66:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  71:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  7c:   0f 1f 40 00             nopl   0x0(%rax)
  80:   89 c0                   mov    %eax,%eax
[hjl@gnu-cfl-2 tmp]$ cat x.s
foo:
        ret
        .p2align 6
        mov %eax,%eax
[hjl@gnu-cfl-2 tmp]$ gcc -c x.s
[hjl@gnu-cfl-2 tmp]$ objdump -dw x.o

x.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <foo>:
   0:   c3                      retq   
   1:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
   c:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  17:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  22:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  2d:   66 66 2e 0f 1f 84 00 00 00 00 00        data16 nopw
%cs:0x0(%rax,%rax,1)
  38:   0f 1f 84 00 00 00 00 00         nopl   0x0(%rax,%rax,1)
  40:   89 c0                   mov    %eax,%eax
[hjl@gnu-cfl-2 tmp]$

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