You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

linuxprefix.S 406B

12345678910111213141516171819202122232425
  1. #include <linux/unistd.h>
  2. .section ".text"
  3. .code64
  4. .globl _start
  5. .type _start, @function
  6. _start:
  7. xorq %rbp, %rbp
  8. popq %rdi // argc -> C arg1
  9. movq %rsp, %rsi // argv -> C arg2
  10. andq $~15, %rsp // 16-byte align the stack
  11. call save_args
  12. /* Our main doesn't use any arguments */
  13. call main
  14. movq %rax, %rdi // rc -> syscall arg1
  15. movq $__NR_exit, %rax
  16. syscall
  17. .size _start, . - _start