Segmentation fault when switching system call the "int" to "syscall" in x86 assembly linux

0

When I change the system call from int $0x80 to syscall or sysenter in this code:

    mov $4, %rax
    mov $1, %rbx
    mov $String1, %rcx
    mov $16, %rdx
    int $0x80

The program ends in segmentation fault. In GDB it shows:

  

Program received signal SIGSEGV, Segmentation fault.   0x00000000f7ffdbe9 in ?? ()

Why is this change causing this impact? Thanks

    
asked by anonymous 03.02.2017 / 03:22

1 answer

1
  • syscall is for x86_64
  • sysenter is for 32 bits
  • int 0x80 works for both

This is a summary of the same question in:
link

    
23.03.2017 / 21:10