[Bug libc/24606] Dynamic TLS address is not congruent with p_vaddr when (p_vaddr % p_align != 0)

rprichard at google dot com sourceware-bugzilla@sourceware.org
Thu May 23 20:38:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=24606

--- Comment #6 from Ryan Prichard <rprichard at google dot com> ---
I see the same thing with aarch64 glibc:

tp          = 0x77f7144710
&tlsvar     = 0x77f71447b1

Based on the value of &tlsvar vs __builtin_thread_pointer(), it appears that a
small-enough TLS segment is automatically allocated in reserved static TLS
space. If I increase the size of tlsvar from 4 to 0x1000, then the test case
fails:

tp          = 0x771d65b710
&tlsvar     = 0x64be7458e0

On x86-64, if I mark tlsvar with __attribute__((tls_model("initial-exec"))),
forcing it into the reserved static TLS area, then the test case passes:

tp          = 0x7f6033d7c700
&tlsvar     = 0x7f6033d7c685

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list