-
Notifications
You must be signed in to change notification settings - Fork 4
/
relocation.notes
28 lines (26 loc) · 1.34 KB
/
relocation.notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Notes on large code model relocations
0000000000000000 <my_print_string>:
0: f3 0f 1e fa endbr64
4: 55 push %rbp
5: 48 89 e5 mov %rsp,%rbp
8: 41 57 push %r15
a: 41 54 push %r12
c: 53 push %rbx
d: 48 81 ec 00 10 00 00 sub $0x1000,%rsp
14: 48 83 0c 24 00 orq $0x0,(%rsp)
19: 48 81 ec 58 01 00 00 sub $0x158,%rsp
20: 48 8d 1d f9 ff ff ff lea -0x7(%rip),%rbx # Absolute RIP
27: 49 bb 00 00 00 00 00 movabs $0x0,%r11 # Offset to base of GOT
2e: 00 00 00
31: 4c 01 db add %r11,%rbx # Absolute GOT address
34: 48 89 bd 98 ee ff ff mov %rdi,-0x1168(%rbp)
3b: 48 b8 00 00 00 00 00 movabs $0x0,%rax #(GOT entry offset from base of GOT)
42: 00 00 00
45: 48 8b 04 03 mov (%rbx,%rax,1),%rax #(load value from GOT entry address)
49: 48 8b 00 mov (%rax),%rax # address of ctx_global
4c: 48 89 45 d0 mov %rax,-0x30(%rbp) # ctx = ctx_global
50: 48 8b 95 98 ee ff ff mov -0x1168(%rbp),%rdx
57: 48 8d 85 a0 ee ff ff lea -0x1160(%rbp),%rax
5e: 48 89 d1 mov %rdx,%rcx
61: 48 ba 00 00 00 00 00 movabs $0x0,%rdx
68: 00 00 00