Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tmp.c
- static inline int foo() {
- asm goto ("jmp %l0" : : : : lab);
- return 1;
- lab:
- return 0;
- }
- int bar() {
- return foo();
- }
- //
- $ gcc -O2 -c tmp.c
- $ objdump -d tmp.o
- tmp.o: file format elf64-x86-64
- Disassembly of section .text:
- 0000000000000000 <bar>:
- 0: eb 0e jmp 10 <bar+0x10>
- 2: b8 01 00 00 00 mov $0x1,%eax
- 7: c3 retq
- 8: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1)
- f: 00
- 10: 31 c0 xor %eax,%eax
- 12: c3 retq
- $ clang -O2 -c -no-integrated-as tmp.c
- $ objdump -d tmp.o
- tmp.o: file format elf64-x86-64
- Disassembly of section .text:
- 0000000000000000 <bar>:
- 0: eb 0e jmp 10 <foo>
- 2: 0f 1f 40 00 nopl 0x0(%rax)
- 6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
- d: 00 00 00
- 0000000000000010 <foo>:
- 10: b8 01 00 00 00 mov $0x1,%eax
- 15: eb 02 jmp 19 <foo+0x9>
- 17: eb 02 jmp 1b <foo+0xb>
- 19: 31 c0 xor %eax,%eax
- 1b: c3 retq
Add Comment
Please, Sign In to add comment