llvm-project/lld/test/ELF/i386-tls-ld-preemptable.s
Fangrui Song 9c371309f3 [ELF][X86] Allow PT_LOAD to have overlapping p_offset ranges on EM_386
Ported the D64906 technique to EM_386.

If `sh_addralign(.tdata) < sh_addralign(.tbss)`,
we can potentially make `p_vaddr(PT_TLS)%p_align(PT_TLS) != 0`.

ld.so that are known to have problems if p_vaddr%p_align!=0:

* FreeBSD 13.0-CURRENT rtld-elf
* glibc https://sourceware.org/bugzilla/show_bug.cgi?id=24606

New test i386-tls-vaddr-align.s checks our workaround makes p_vaddr%p_align = 0.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D65865

llvm-svn: 369347
2019-08-20 08:43:47 +00:00

19 lines
477 B
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=i386 %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
# CHECK: 11ef: movl (%eax), %eax
# We used to error on R_386_TLS_LDO_32 to preemptable symbols.
# i is STB_GLOBAL and preemptable.
leal i@TLSLDM(%ebx), %eax
calll __tls_get_addr@PLT
movl i@DTPOFF(%eax), %eax # R_386_TLS_LDO_32
.section .tbss,"awT",@nobits
.globl i
i:
.long 0
.size i, 4