Add support for Mach-O thread local variables#68
Open
Popax21 wants to merge 1 commit intonetwide-assembler:masterfrom
Open
Add support for Mach-O thread local variables#68Popax21 wants to merge 1 commit intonetwide-assembler:masterfrom
Popax21 wants to merge 1 commit intonetwide-assembler:masterfrom
Conversation
This patch adds support for thread local sections, which were previously unimplemented. Specifically, it allows the user to emit sections with the types `S_THREAD_LOCAL_REGULAR` (for `.tdata` and the new `thread_data` section attribute) and `S_THREAD_LOCAL_ZEROFILL` (for `.tbss` and the new `thread_bss/zerofill` attribute). Additionally, it also maps specific section names to the section types `S_THREAD_LOCAL_VARIABLES` (`__thread_vars`), `S_THREAD_LOCAL_VARIABLE_POINTERS` (`__thread_ptrs`) and `S_THREAD_LOCAL_INIT_FUNCTION_POINTERS` (`__thread_init` - note that I couldn't determine how this section type is usually named, so I chose my own name). These special section names don't have an associated Unix section name, yet are sometimes still required when interacting with thread local variables. I hereby sign off the Developer’s Certificate of Origin 1.1.
Contributor
|
Has this been reviewed? |
Member
|
This is great, but it needs documentation. It might possibly be nicer to use "wrt ..tls" for compatibility with ELF, though. |
Member
|
Question: right now we don't have anyone on the NASM team who is familiar with the intricacies of MachO. Would you be able to help with information and/or validation if we need to make changes that affect the MachO backend? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds support for thread local sections, which were previously unimplemented. Specifically, it allows the user to emit sections with the types
S_THREAD_LOCAL_REGULAR(for.tdataand the newthread_datasection attribute) andS_THREAD_LOCAL_ZEROFILL(for.tbssand the newthread_bss/zerofillattribute). Additionally, it also maps specific section names to the section typesS_THREAD_LOCAL_VARIABLES(__thread_vars),S_THREAD_LOCAL_VARIABLE_POINTERS(__thread_ptrs) andS_THREAD_LOCAL_INIT_FUNCTION_POINTERS(__thread_init- note that I couldn't determine how this section type is usually named, so I chose my own name). These special section names don't have an associated Unix section name, yet are sometimes still required when interacting with thread local variables.I hereby sign off the Developer’s Certificate of Origin 1.1.