I am writing some simple x86 assembly and when I run the following code
extern printf
global main
section .data
fmt: db "%d", 0x0a, 0
section .text
main:
mov rax, 1
; sys_exit(0)
mov rdi, 0
mov rax, 60
syscall
everthing runs fine.
However, if I leave off everything after the comment ; sys_exit(0)
then I receive a Segmentation Fault.
Is calling sys_exit required or is something else happening?