Skip to content

Instantly share code, notes, and snippets.

@shirok
Created August 10, 2018 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shirok/efc2ad52b4620b3de69574334ebcc75c to your computer and use it in GitHub Desktop.
Save shirok/efc2ad52b4620b3de69574334ebcc75c to your computer and use it in GitHub Desktop.
shiro@scherzo:~/src/Gauche$ cc -c t.c
shiro@scherzo:~/src/Gauche$ objdump -d t.o
t.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <main>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 83 ec 10 sub $0x10,%rsp
8: 89 7d fc mov %edi,-0x4(%rbp)
b: 48 89 75 f0 mov %rsi,-0x10(%rbp)
f: 68 d2 04 00 00 pushq $0x4d2
14: 68 d2 04 00 00 pushq $0x4d2
19: 68 d2 04 00 00 pushq $0x4d2
1e: 68 d2 04 00 00 pushq $0x4d2
23: 41 b9 d2 04 00 00 mov $0x4d2,%r9d
29: 41 b8 d2 04 00 00 mov $0x4d2,%r8d
2f: b9 d2 04 00 00 mov $0x4d2,%ecx
34: ba d2 04 00 00 mov $0x4d2,%edx
39: be d2 04 00 00 mov $0x4d2,%esi
3e: bf d2 04 00 00 mov $0x4d2,%edi
43: e8 00 00 00 00 callq 48 <main+0x48>
48: 48 83 c4 20 add $0x20,%rsp
4c: 68 2e 16 00 00 pushq $0x162e
51: 68 2e 16 00 00 pushq $0x162e
56: 68 2e 16 00 00 pushq $0x162e
5b: 68 2e 16 00 00 pushq $0x162e
60: 41 b9 2e 16 00 00 mov $0x162e,%r9d
66: 41 b8 2e 16 00 00 mov $0x162e,%r8d
6c: b9 2e 16 00 00 mov $0x162e,%ecx
71: ba 2e 16 00 00 mov $0x162e,%edx
76: be 2e 16 00 00 mov $0x162e,%esi
7b: bf 2e 16 00 00 mov $0x162e,%edi
80: e8 00 00 00 00 callq 85 <main+0x85>
85: 48 83 c4 20 add $0x20,%rsp
89: b8 00 00 00 00 mov $0x0,%eax
8e: c9 leaveq
8f: c3 retq
extern void foo(int, int, int, int, int, int, int, int, int, int);
extern void bar(long, long, long, long, long, long, long, long, long, long);
int main(int argc, char **argv)
{
foo(1234,1234,1234,1234,1234,1234,1234,1234,1234,1234);
bar(5678,5678,5678,5678,5678,5678,5678,5678,5678,5678);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment