annotate SSR.s @ 27:2c146b6b3890
fixing problems with linker by including the right file
| author |
Merten Sach <msach@mailbox.tu-berlin.de> |
| date |
Mon, 29 Aug 2011 14:17:43 +0200 |
| parents |
|
| children |
|
| rev |
line source |
|
Nina@26
|
1
|
|
Nina@26
|
2 //Assembly code takes the return addr off the stack and saves
|
|
Nina@26
|
3 // into the singleton. The first field in the singleton is the
|
|
Nina@26
|
4 // "endInstrAddr" field, and the return addr is at 0x4(%ebp)
|
|
Nina@26
|
5 .globl asm_save_ret_to_singleton
|
|
Nina@26
|
6 asm_save_ret_to_singleton:
|
|
Nina@26
|
7 movq 0x8(%rbp), %rax #get ret address, ebp is the same as in the calling function
|
|
Nina@26
|
8 movq %rax, (%rdi) #write ret addr to endInstrAddr field
|
|
Nina@26
|
9 ret
|
|
Nina@26
|
10
|
|
Nina@26
|
11
|
|
Nina@26
|
12 //Assembly code changes the return addr on the stack to the one
|
|
Nina@26
|
13 // saved into the singleton by the end-singleton-fn
|
|
Nina@26
|
14 //The stack's return addr is at 0x4(%%ebp)
|
|
Nina@26
|
15 .globl asm_write_ret_from_singleton
|
|
Nina@26
|
16 asm_write_ret_from_singleton:
|
|
Nina@26
|
17 movq (%rdi), %rax #get endInstrAddr field
|
|
Nina@26
|
18 movq %rax, 0x8(%rbp) #write return addr to the stack of the caller
|
|
Nina@26
|
19 ret
|
|
Nina@26
|
20
|
|
Nina@26
|
21
|