44 lines · plain
1// This test checks dynamic relocations support for aarch64.2 3RUN: yaml2obj %p/Inputs/rels-so.yaml &> %t.so4RUN: yaml2obj %p/Inputs/rels-exe.yaml &> %t.exe5RUN: llvm-bolt %t.so -o %t.bolt.so --use-old-text=0 --lite=06RUN: llvm-bolt %t.exe -o %t.bolt.exe --use-old-text=0 --lite=07 8// Check relocations in library:9 10RUN: llvm-readelf -rW %t.bolt.so | FileCheck %s -check-prefix=CHECKLIB11 12CHECKLIB: {{.*}} R_AARCH64_GLOB_DAT {{.*}} a + 013CHECKLIB: {{.*}} R_AARCH64_TLSDESC {{.*}} t1 + 014CHECKLIB: {{.*}} R_AARCH64_ABS64 {{.*}} a + 015 16// Check relocations in executable:17 18RUN: llvm-readelf -rW %t.bolt.exe | FileCheck %s -check-prefix=CHECKEXE19 20CHECKEXE: {{.*}} R_AARCH64_TLS_TPREL64 {{.*}} t1 + 021CHECKEXE: {{.*}} R_AARCH64_COPY {{.*}} a + 022CHECKEXE: {{.*}} R_AARCH64_JUMP_SLOT {{.*}} inc + 023 24// Check traditional TLS relocations R_AARCH64_TLS_DTPMOD64 and25// R_AARCH64_TLS_DTPREL64 emitted correctly after bolt. Since these26// relocations are obsolete and clang and lld does not support them,27// the initial binary was built with gcc and ld with -mtls-dialect=trad flag.28 29RUN: yaml2obj %p/Inputs/tls-trad.yaml &> %t.trad.so30RUN: llvm-bolt %t.trad.so -o %t.trad.bolt.so --use-old-text=0 --lite=031RUN: llvm-readelf -rW %t.trad.so | FileCheck %s -check-prefix=CHECKTRAD32 33CHECKTRAD: {{.*}} R_AARCH64_TLS_DTPMOD64 {{.*}} t1 + 034CHECKTRAD: {{.*}} R_AARCH64_TLS_DTPREL64 {{.*}} t1 + 035 36// The ld linker emits R_AARCH64_TLSDESC to .rela.plt section, check that37// it is emitted correctly.38 39RUN: yaml2obj %p/Inputs/tls-ld.yaml &> %t.ld.so40RUN: llvm-bolt %t.ld.so -o %t.ld.bolt.so --use-old-text=0 --lite=041RUN: llvm-readelf -rW %t.ld.bolt.so | FileCheck %s -check-prefix=CHECKLD42 43CHECKLD: {{.*}} R_AARCH64_TLSDESC {{.*}} t1 + 044