Summary: The linker can generate 8- or 16-byte entries in .plt.got and .plt.sec sections. On X86, the main differentiator is the presence of endbr64 instruction at the beginning of the entry. Detect the instruction and adjust the size accordingly. (cherry picked from FBD29847639)
12 lines
544 B
Plaintext
12 lines
544 B
Plaintext
## Check that llvm-bolt correctly identifies functions in .plt.sec
|
|
# RUN: yaml2obj %p/Inputs/plt-sec.yaml &> %t.exe
|
|
# RUN: llvm-bolt %t.exe -print-cfg -print-only=foo -o %t.out | FileCheck %s
|
|
|
|
## Check that llvm-bolt correctly identifies functions in .plt.got that has
|
|
## endbr instruction at the start of its entries.
|
|
# RUN: yaml2obj %p/Inputs/plt-got-sec.yaml &> %t.exe
|
|
# RUN: llvm-bolt %t.exe -print-cfg -print-only=foo -o %t.out | FileCheck %s
|
|
|
|
## The only call instruction in function foo() should be a call to PLT.
|
|
CHECK: callq puts@PLT
|