Skip to content

Instantly share code, notes, and snippets.

@h4ck3rm1k3
Created November 18, 2016 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4ck3rm1k3/61fe8e682c5020c6a96a089249f3a26a to your computer and use it in GitHub Desktop.
Save h4ck3rm1k3/61fe8e682c5020c6a96a089249f3a26a to your computer and use it in GitHub Desktop.

Is this a bug in gnu objdump?

Input to as :

.test16:
.byte 77
.byte 0
.byte 1
.byte 1
.byte 1
.byte 1
.test17:
.byte 77
.byte 1
.byte 0
.byte 0
.byte 0
.byte 0 

Output of objdump :

000000000000005a <.test16>:
5a: 4d 00 01 rex.WRB add %r8b,(%r9)
5d: 01 01 add %eax,(%rcx)
5f: 01 .byte 0x1

0000000000000060 <.test17>:
60: 4d 01 00 add %r8,(%r8)
63: 00 00 add %al,(%rax)
...

http://ref.x86asm.net/coder64.html#x4D 4D is the opcode of REX.WRB

@h4ck3rm1k3
Copy link
Author

Next test :

.test17:
.byte 77
.byte 1

.test17b:
.byte 77
.byte 1
.byte 0

.test17c:
.byte 77
.byte 1
.byte 1

output :

Disassembly of section .text:

0000000000000000 <.test17>:
   0:   4d                      rex.WRB
   1:   01                      .byte 0x1

0000000000000002 <.test17b>:
   2:   4d 01 00                add    %r8,(%r8)

0000000000000005 <.test17c>:
   5:   4d 01 01                add    %r8,(%r9)

@h4ck3rm1k3
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment