TLS Variant I may not satisfy offset%p_align == (base+p_vaddr)%p_align

Fāng-ruì Sòng emacsray at gmail.com
Tue May 14 15:45:49 UTC 2019


See https://reviews.llvm.org/D61824

For the PT_TLS segment in the main module, currently when
p_vaddr%p_align!=0, FreeBSD rtld behaves like musl (1.1.20~1.1.22) - it
aligns the TLS block to 0 modulo main_tls_align. This is incorrect.

According to Szabolcs Nagy, glibc/elf/dl-tls.c is correct and FreeBSD
rtld/musl/Bionic are wrong.

This revision is related: https://reviews.freebsd.org/D16510

I did a quick test with qemu-system-aarch64
FreeBSD-13.0-CURRENT-arm64-aarch64-20190510-r347415-mini-memstick.img while
investigating the Android breakage. I haven't looked into the source
carefully.


More information about the freebsd-toolchain mailing list