The invention discloses a context-aware-based gap
containerization TLS compatible method, which comprises the following steps of: distinguishing a simple TLS variable and a complex TLS variable in a source gap
system, and establishing a TLS
variable source feature; the method comprises the following steps: constructing a dynamic telescopic TLS
memory pool matched with a variable access permission in a target
system, expanding a kernel state TLS segment descriptor, constructing a bidirectional mapping table of musl TLS offset and a
memory pool address, and optimizing and constructing a clustering structure aligned with a
CPU cache line for a hotspot variable to improve the access efficiency; tLS variable access tracks are recorded through a dynamic
binary translation engine, TLS segment descriptors are updated, the descriptors are read during thread switching to recover TLS context and refresh cache to guarantee consistency, address and offset conversion is completed according to target
system alignment requirements by combining source features and a bidirectional mapping table for TLS variables of nested structures, pointers and array types, and the TLS variables of the nesting structures, the pointers and the array types are aligned. And completing dynamic conversion execution of the
source system application program in the target system.