mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 05:12:50 +00:00
The harness stores the thread's TLS base in the TEB's TLS pointer field, and setup_tls mapped the thread's copy of the template at that address. Compiled code indexes that pointer by the module's TLS index to find the data block, so it took the first eight bytes of the template for the block address. - tls.rs: setup_tls maps a pointer array at the thread's TLS base and the data block one page above it, and stores the block address in the slot of the index it assigns. startup.rs is unchanged. - tests/tls_layout.rs: follows the access sequence through guest memory for a template with zero fill, a rebased image and a zero-fill-only directory, and checks the image's template is left alone. Signed-off-by: sahib453 <117431595+sahib453@users.noreply.github.com>