Created
July 28, 2017 22:06
-
-
Save simark/25e23c91a2332009982ca54fa9b2bc4d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.extern bar | |
.text | |
.globl foo | |
.type foo, @function | |
foo: | |
.cfi_startproc | |
xor %rsp, (%rsp) | |
// exp RA len const -8 plus dup deref xor | |
.cfi_escape 0x16, 0x10, 0x06, 0x09, 0xf8, 0x22, 0x12, 0x06, 0x27 | |
pushq %rbp | |
.cfi_def_cfa_offset 16 | |
.cfi_offset 6, -16 | |
movq %rsp, %rbp | |
.cfi_def_cfa_register 6 | |
movl %edi, -4(%rbp) | |
call bar | |
movl -4(%rbp), %eax | |
addl %eax, %eax | |
popq %rbp | |
.cfi_def_cfa 7, 8 | |
xor %rsp, (%rsp) | |
ret | |
.cfi_endproc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int foo(int); | |
void bar(void) | |
{ | |
printf("Hi!\n"); | |
} | |
int main () | |
{ | |
return foo (4); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment