Skip to content

Instantly share code, notes, and snippets.

@7shi
Forked from shigemk2/param.cpp
Last active August 29, 2015 14:20
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 7shi/06c1493f332569cc0c5e to your computer and use it in GitHub Desktop.
Save 7shi/06c1493f332569cc0c5e to your computer and use it in GitHub Desktop.
void inc(int &x) {
++x;
}
void inc(int *x) {
++*x;
}
param.o: ファイル形式 pe-x86-64
セクション .text の逆アセンブル:
0000000000000000 <_Z3incRi>:
void inc(int &x) {
++x;
0: 83 01 01 add DWORD PTR [rcx],0x1
3: c3 ret
0000000000000004 <_Z3incPi>:
}
void inc(int *x) {
++*x;
4: 83 01 01 add DWORD PTR [rcx],0x1
7: c3 ret
g++ -O -fomit-frame-pointer -m64 -c -g param.cpp
objdump -S param.o -M intel > param.o.objdump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment