Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern int __start[];
- extern int __end[];
- extern void bar(int *);
- void foo()
- {
- for (int *x = __start; x != __end; ++x)
- bar(x);
- }
- /*
- * $ gcc -O3 -c arrays.c && objdump -d arrays.o
- *
- * arrays.o: file format elf64-x86-64
- *
- *
- * Disassembly of section .text:
- *
- * 0000000000000000 <foo>:
- * 0: 53 push %rbx
- * 1: bb 00 00 00 00 mov $0x0,%ebx
- * 6: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1)
- * d: 00 00 00
- * 10: 48 89 df mov %rbx,%rdi
- * 13: 48 83 c3 04 add $0x4,%rbx
- * 17: e8 00 00 00 00 callq 1c <foo+0x1c>
- * 1c: eb f2 jmp 10 <foo+0x10>
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement