<
+
0
>: push rbx
<
+
1
>: mov r10,rdi ;r10
=
rdi
=
LinkMap
<
+
4
>: mov esi,esi
<
+
6
>: lea rdx,[rsi
+
rsi
*
2
] ;rdx
=
rsi
=
0
<
+
10
>: sub rsp,
0x10
;const char
*
strtab
=
(const void
*
)D_PTR(l, l_info[DT_STRTAB]);
<
+
14
>: mov rax,QWORD PTR [rdi
+
0x68
] ;rax
=
DT_STRTAB
<
+
18
>: mov rdi,QWORD PTR [rax
+
0x8
] ;rdi
=
ELF String Table
;const PLTREL
*
const reloc
=
(const void
*
)(D_PTR(l, l_info[DT_JMPREL])
+
reloc_offset);
<
+
22
>: mov rax,QWORD PTR [r10
+
0xf8
] ;rax
=
DT_JMPREL
<
+
29
>: mov rax,QWORD PTR [rax
+
0x8
] ;rax
=
Elf64_Rela
;const ElfW(Sym)
*
const symtab
=
(const void
*
)D_PTR(l, l_info[DT_SYMTAB]);
<
+
33
>: lea r8,[rax
+
rdx
*
8
] ;r8
=
rax
=
Elf64_Rela
<
+
37
>: mov rax,QWORD PTR [r10
+
0x70
] ;rax
=
DT_SYMTAB
;const PLTREL
*
const reloc
=
(const void
*
)(D_PTR(l, l_info[DT_JMPREL])
+
reloc_offset);
<
+
41
>: mov rcx,QWORD PTR [r8
+
0x8
] ;rcx
=
Elf64_Rela
-
>r_info
<
+
45
>: mov rbx,QWORD PTR [r8] ;rbx
=
Elf64_Rela
-
>r_offset
const ElfW(Sym)
*
sym
=
&symtab[ELFW(R_SYM)(reloc
-
>r_info)];
<
+
48
>: mov rax,QWORD PTR [rax
+
0x8
] ;rax
=
Elf64_Sym
<
+
52
>: mov rdx,rcx ;rdx
=
rcx
=
Elf64_Rela
-
>r_info
<
+
55
>: shr rdx,
0x20
;rdx
=
rdx >>
0x20
=
Elf64_Rela
-
>r_info>>
0x20
<
+
59
>: lea rsi,[rdx
+
rdx
*
2
]
<
+
63
>: lea rsi,[rax
+
rsi
*
8
] ;rsi
=
Elf64_Sym[Elf64_Rela
-
>r_info >>
32
]
;const PLTREL
*
const reloc
=
(const void
*
)(D_PTR(l, l_info[DT_JMPREL])
+
reloc_offset);
<
+
67
>: mov rax,QWORD PTR [r10] ;rax
=
linkMap
-
>l_addr
<
+
70
>: mov QWORD PTR [rsp
+
0x8
],rsi ;var_sym
=
rsi
<
+
75
>: add rbx,rax
;
assert
(ELFW(R_TYPE)(reloc
-
>r_info)
=
=
ELF_MACHINE_JMP_SLOT);
<
+
78
>:
cmp
ecx,
0x7
<
+
81
>: jne
0x7fa516a0ff64
<_dl_fixup
+
372
>
;
if
(__builtin_expect(ELFW(ST_VISIBILITY)(sym
-
>st_other),
0
)
=
=
0
)
<
+
87
>: test BYTE PTR [rsi
+
0x5
],
0x3
<
+
91
>: jne
0x7fa516a0fee8
<_dl_fixup
+
248
>
<
+
97
>: mov rax,QWORD PTR [r10
+
0x1c8
]
<
+
104
>: xor r8d,r8d
<
+
107
>: test rax,rax
<
+
110
>: je
0x7fa516a0fe8c
<_dl_fixup
+
156
>
<
+
112
>: mov rax,QWORD PTR [rax
+
0x8
]
<
+
116
>: movzx eax,WORD PTR [rax
+
rdx
*
2
]
<
+
120
>:
and
eax,
0x7fff
<
+
125
>: lea rdx,[rax
+
rax
*
2
]
<
+
129
>: mov rax,QWORD PTR [r10
+
0x2e0
]
<
+
136
>: lea r8,[rax
+
rdx
*
8
]
<
+
140
>: mov eax,
0x0
<
+
145
>: mov r9d,DWORD PTR [r8
+
0x8
]
<
+
149
>: test r9d,r9d
<
+
152
>: cmove r8,rax
<
+
156
>: mov edx,DWORD PTR fs:
0x18
<
+
164
>: test edx,edx
<
+
166
>: mov eax,
0x1
<
+
171
>: jne
0x7fa516a0ff48
<_dl_fixup
+
344
>
<
+
177
>: mov esi,DWORD PTR [rsi]
<
+
179
>: mov rcx,QWORD PTR [r10
+
0x380
]
<
+
186
>: lea rdx,[rsp
+
0x8
]
<
+
191
>: push
0x0
<
+
193
>: push rax
<
+
194
>: mov r9d,
0x1
<
+
200
>: add rdi,rsi
<
+
203
>: mov rsi,r10
<
+
206
>: call
0x7fa516a0b0b0
<_dl_lookup_symbol_x>
<
+
211
>: mov r8,rax
<
+
214
>: mov eax,DWORD PTR fs:
0x18
<
+
222
>: test eax,eax
<
+
224
>: pop rcx
<
+
225
>: pop rsi
<
+
226
>: jne
0x7fa516a0ff10
<_dl_fixup
+
288
>
<
+
228
>: mov rsi,QWORD PTR [rsp
+
0x8
]
<
+
233
>: xor eax,eax
;
if
(sym !
=
NULL && __builtin_expect(ELFW(ST_TYPE)(sym
-
>st_info)
=
=
STT_GNU_IFUNC,
0
))
<
+
235
>: test rsi,rsi
<
+
238
>: je
0x7fa516a0fef8
<_dl_fixup
+
264
>;sym
=
=
NULL
<
+
240
>: test r8,r8
<
+
243
>: je
0x7fa516a0fee8
<_dl_fixup
+
248
>
<
+
245
>: mov rax,QWORD PTR [r8]
;value
=
DL_FIXUP_MAKE_VALUE(l, l
-
>l_addr
+
sym
-
>st_value);
<
+
248
>: movzx edx,BYTE PTR [rsi
+
0x4
] ;edx
=
[rsi
+
0x4
]
=
sym
-
>st_info
<
+
252
>: add rax,QWORD PTR [rsi
+
0x8
] ;rax
=
rax
+
[rsi
+
0x8
]
=
linkMap
-
>l_addr
+
sym
-
>st_value 此命令执行完后rax
=
真正函数地址
;
if
(sym !
=
NULL && __builtin_expect(ELFW(ST_TYPE)(sym
-
>st_info)
=
=
STT_GNU_IFUNC,
0
))
<
+
256
>:
and
edx,
0xf
<
+
259
>:
cmp
dl,
0xa
;
if
sym
-
>st_info
=
=
STT_GNU_IFUNC
<
+
262
>: je
0x7fa516a0ff60
<_dl_fixup
+
368
>
;
if
(__glibc_unlikely(GLRO(dl_bind_not)))
<
+
264
>: mov edx,DWORD PTR [rip
+
0x2178aa
] ;edx
=
dl_bind_not
<
+
270
>: test edx,edx
<
+
272
>: jne
0x7fa516a0ff05
<_dl_fixup
+
277
> ;
if
(__glibc_unlikely(GLRO(dl_bind_not)))
;
return
value;
<
+
274
>: mov QWORD PTR [rbx],rax ;reloc
=
绑定查询结果
<
+
277
>: add rsp,
0x10
<
+
281
>: pop rbx
<
+
282
>: ret
<
+
283
>: nop DWORD PTR [rax
+
rax
*
1
+
0x0
]
<
+
288
>: xor eax,eax
<
+
290
>: xchg DWORD PTR fs:
0x1c
,eax
<
+
298
>:
cmp
eax,
0x2
<
+
301
>: jne
0x7fa516a0fed4
<_dl_fixup
+
228
>
<
+
303
>: mov rdi,QWORD PTR fs:
0x10
<
+
312
>: xor r10d,r10d
<
+
315
>: add rdi,
0x1c
<
+
319
>: mov edx,
0x1
<
+
324
>: mov esi,
0x81
<
+
329
>: mov eax,
0xca
<
+
334
>: syscall
<
+
336
>: jmp
0x7fa516a0fed4
<_dl_fixup
+
228
>
<
+
338
>: nop WORD PTR [rax
+
rax
*
1
+
0x0
]
<
+
344
>: mov DWORD PTR fs:
0x1c
,
0x1
<
+
356
>: mov eax,
0x5
<
+
361
>: jmp
0x7fa516a0fea1
<_dl_fixup
+
177
>
<
+
366
>: xchg ax,ax
;value
=
elf_ifunc_invoke(DL_FIXUP_VALUE_ADDR(value));
<
+
368
>: call rax
<
+
370
>: jmp
0x7fa516a0fef8
<_dl_fixup
+
264
> ;
if
(__glibc_unlikely(GLRO(dl_bind_not)))
<
+
372
>: lea rcx,[rip
+
0x132fd
]
<
+
379
>: lea rsi,[rip
+
0x1115a
]
<
+
386
>: lea rdi,[rip
+
0x132b7
]
<
+
393
>: mov edx,
0x50
<
+
398
>: call
0x7fa516a1b790
<__GI___assert_fail>;重定位类型不等于
7