On Tue, Feb 21, 2012 at 06:11:54PM +0400, Kirill Yukhin wrote:
> As far as I undersand, correct one seems like that:
> .intel_syntax
>         xbegin $0
>         nop
> 
> .att_syntax
>         xbegin ($0)
>         nop
> 
> Which disassembles into:
> 0000000000000000 <.text>:
>    0:   c7 f8 00 00 00 00       xbeginq 0x6
>    6:   90                      nop
>    7:   c7 f8 00 00 00 00       xbeginq 0xd
>    d:   90                      nop

Doesn't seem to do what you expect (nor xbegin $0 in Intel syntax):
$ /usr/src/binutils/obj/gas/as-new -o /tmp/a.o /tmp/a.s
$ cat /tmp/a.s
#.intel_syntax noprefix
nop
xbegin ($0)
nop
xbegin .+6
nop
$ /usr/src/binutils/obj/binutils/objdump -dr /tmp/a.o

/tmp/a.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <.text>:
   0:   90                      nop
   1:   c7 f8 00 00 00 00       xbeginq 0x7
   3: R_X86_64_PC32     $0+0xfffffffffffffffc
   7:   90                      nop
   8:   c7 f8 00 00 00 00       xbeginq 0xe
   e:   90                      nop

Note the relocation in there, you don't want there any.

        Jakub

Reply via email to