To reproduce the problem:
clang -c test.s
clang -c test2.s
llvm-ar rc test2.a test2.o
ld.lld -shared -o test.so test2.a test.o
with
test.s:
addq a at GOTTPOFF(%rip), %rax
test2.s:
.section .tdata,"awT", at progbits
.globl a
a:
.long 42
Cheers,
Rafael