Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/archinfo/tls.py: 100%
2 statements
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-25 06:15 +0000
« prev ^ index » next coverage.py v7.3.1, created at 2023-09-25 06:15 +0000
1from collections import namedtuple
3# REFERENCES:
4# [1] https://www.uclibc.org/docs/tls.pdf
5# [2] https://www.uclibc.org/docs/tls-ppc.txt
6# [3] https://www.uclibc.org/docs/tls-ppc64.txt
7# [4] https://www.linux-mips.org/wiki/NPTL
9TLSArchInfo = namedtuple(
10 "TLSArchInfo",
11 ("variant", "tcbhead_size", "head_offsets", "dtv_offsets", "pthread_offsets", "tp_offset", "dtv_entry_offset"),
12)
13# variant: 1 or 2 based on the memory layout scheme
14# tcbhead_size: the size of the thread control block head struct
15# head_offsets: the offsets in the the tcb struct where a pointer to the head is kept
16# dtv_offsets: the offsets in the tcb struct where a pointer to the dtv is kept
17# pthread_offsets: the offsets in the tcb struct where a pointer to libc's pthread data is kept, I guess?
18# tp_offset: the offset between the thread pointer from [1] and the thread pointer given to the program, see [2],[3]
19# dtv_entry_offset: the offset between the value stored in the dtv and the actual start of the given dtv entry