freebsd-src/libexec/rtld-elf/amd64
Fangrui Song e6c7696203 rtld: Fix i386/amd64 TP offset when p_vaddr % p_align != 0
For a Variant II architecture, the TP offset of a TLS symbol is st_value -
tlsoffset + r_addend. tlsoffset is computed by either calculate_tls_offset
or calculate_first_tls_offset.

The return value of calculate_first_tls_offset is the smallest integer
satisfying res >= size and (-res) % p_align = p_vaddr % p_align
(= p_offset % p_align).  (The formula is a bit contrived. The basic idea
is to subtract the minimum integer from size + align - 1 so that the result
ihas the expected remainder.)

Reviewed by:	kib
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D31538
Differential revision:	https://reviews.freebsd.org/D31541
2021-08-16 13:55:34 +03:00
..
Makefile.inc rtld: clean up Makefile. 2020-01-11 09:18:58 +00:00
reloc.c rtld: Fix i386/amd64 TP offset when p_vaddr % p_align != 0 2021-08-16 13:55:34 +03:00
rtld_machdep.h rtld: define TLS_DTV_OFFSET on all architectures 2021-04-09 23:46:24 +03:00
rtld_start.S