-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
darwin(x86/arm64): Initialize TLV area on loading
Dyld's tlv_get_addr function retrieves the thread local storage by using a descriptor's key to index into the thread local storage held in gsbase on x86 or TPIDRRO_EL0 on arm64 to retrieve a thread- and module- specific data area to offset into. If this offset-specific area pointer is NULL, it will be lazily allocated by tlv_get_addr through a call to RuntimeState::_instantiateTLVs. This allocates the area, using a size stored in a Dyld-private vector _tlvInfos, and copies over intial data. When a module is loaded through Dyld, it stores the nesseary size along with the key in _tlvInfos. Since we don't have a way to insert our newly generated key into this array through public (and hence stable) APIs, we pre-allocate and initialize the per-thread area for the initial thread in the runtime.
- Loading branch information
1 parent
5ec3456
commit 03de284
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters