mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 01:26:04 +00:00

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
19 lines
477 B
ArmAsm
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
|