42 lines · plain
1// REQUIRES: arm2// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1.o3// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so4// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7a-linux-gnueabi5// RUN: ld.lld %t1.so %t.o -o %t6// RUN: llvm-objdump -s %t | FileCheck %s7 8/// This tls global-dynamic sequence is with respect to a non-preemptible9/// symbol in an application so a relaxation to Local Exec would normally be10/// possible. This would result in an assertion failure on ARM as the11/// relaxation functions can't be implemented on ARM. Check that the sequence12/// is handled as global dynamic13 14 .text15 .syntax unified16 .globl func17 .p2align 218 .type func,%function19func:20.L0:21 .globl __tls_get_addr22 bl __tls_get_addr23 bx lr24 .p2align 225 .Lt0: .word x(TLSGD) + (. - .L0 - 8)26 27 .globl x28.section .tbss,"awT",%nobits29 .p2align 230x:31 .space 432 .type x, %object33 34// CHECK: Contents of section .got:35/// Module index is always 1 for executable36// CHECK-NEXT: 30268 01000000 0000000037 38 39/// Without any definition of __tls_get_addr we get an error40// RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s41// ERR: error: undefined symbol: __tls_get_addr42