|
7 | 7 | // RUN: llvm-bolt %t.O0.exe -o %t.O0.bolt.exe \
|
8 | 8 | // RUN: --print-disasm --print-only=_start | \
|
9 | 9 | // RUN: FileCheck --check-prefix=O0_CHECK %s
|
| 10 | +// RUN: llvm-readelf -aW %t.O0.bolt.exe | \ |
| 11 | +// RUN: FileCheck --check-prefix=REL_CHECK %s |
| 12 | + |
| 13 | +// Non-pie static executable doesn't generate PT_DYNAMIC, check relocation |
| 14 | +// is readed successfully and IPLT trampoline has been identified by bolt. |
| 15 | +// RUN: %clang %cflags -nostdlib -O3 %s -fuse-ld=lld -no-pie \ |
| 16 | +// RUN: -o %t.O3_nopie.exe -Wl,-q |
| 17 | +// RUN: llvm-readelf -l %t.O3_nopie.exe | \ |
| 18 | +// RUN: FileCheck --check-prefix=NON_DYN_CHECK %s |
| 19 | +// RUN: llvm-bolt %t.O3_nopie.exe -o %t.O3_nopie.bolt.exe \ |
| 20 | +// RUN: --print-disasm --print-only=_start | \ |
| 21 | +// RUN: FileCheck --check-prefix=O3_CHECK %s |
| 22 | +// RUN: llvm-readelf -aW %t.O3_nopie.bolt.exe | \ |
| 23 | +// RUN: FileCheck --check-prefix=REL_CHECK %s |
10 | 24 |
|
11 | 25 | // With -O3 direct call is performed on IPLT trampoline. IPLT trampoline
|
12 | 26 | // doesn't have associated symbol. The ifunc symbol has the same address as
|
|
16 | 30 | // RUN: llvm-bolt %t.O3_pie.exe -o %t.O3_pie.bolt.exe \
|
17 | 31 | // RUN: --print-disasm --print-only=_start | \
|
18 | 32 | // RUN: FileCheck --check-prefix=O3_CHECK %s
|
| 33 | +// RUN: llvm-readelf -aW %t.O3_pie.bolt.exe | \ |
| 34 | +// RUN: FileCheck --check-prefix=REL_CHECK %s |
19 | 35 |
|
20 | 36 | // Check that IPLT trampoline located in .plt section are normally handled by
|
21 | 37 | // BOLT. The gnu-ld linker doesn't use separate .iplt section.
|
|
24 | 40 | // RUN: llvm-bolt %t.iplt_O3_pie.exe -o %t.iplt_O3_pie.bolt.exe \
|
25 | 41 | // RUN: --print-disasm --print-only=_start | \
|
26 | 42 | // RUN: FileCheck --check-prefix=O3_CHECK %s
|
| 43 | +// RUN: llvm-readelf -aW %t.iplt_O3_pie.bolt.exe | \ |
| 44 | +// RUN: FileCheck --check-prefix=REL_CHECK %s |
| 45 | + |
| 46 | +// NON_DYN_CHECK-NOT: DYNAMIC |
27 | 47 |
|
28 | 48 | // O0_CHECK: adr x{{[0-9]+}}, ifoo
|
29 | 49 | // O3_CHECK: b "{{resolver_foo|ifoo}}{{.*}}@PLT"
|
30 | 50 |
|
| 51 | +// REL_CHECK: R_AARCH64_IRELATIVE [[#%x,REL_SYMB_ADDR:]] |
| 52 | +// REL_CHECK: [[#REL_SYMB_ADDR]] {{.*}} FUNC {{.*}} resolver_foo |
| 53 | + |
31 | 54 | static void foo() {}
|
32 | 55 |
|
33 | 56 | static void *resolver_foo(void) { return foo; }
|
|
0 commit comments