Darwin: Prepares for NeXT metadata handling, allows metadata in const_data
Darwin's Objective-C handling is updated for NeXT metadata, allowing it in const data and making ClassList symbols linker-visible.
This commit makes Darwin-specific preparations for handling NeXT metadata, as tracked by PR 124260. It allows metadata to be placed in const_data sections and ensures that ClassList symbols are linker-visible. Additionally, comments within the ImageInfo metadata flags are expanded for clarity.
In Details
The config/darwin.cc file is updated to allow Objective-C metadata, specifically for NeXT runtime compatibility, to reside within the const_data section. The darwin_label_is_anonymous_local_objc_name function is modified to make ClassList symbols linker-visible, addressing issues related to symbol resolution for Objective-C runtime metadata. Comments clarifying the fields within the ImageInfo structure are also improved, including a correction to avoid claiming signed pointer support when it's not used.
- Darwin
- Apple's Unix-based operating system, which forms the basis for macOS, iOS, watchOS, and tvOS. GCC has specific backends for generating code for Darwin targets.
- NeXT metadata
- Refers to metadata associated with the NeXTSTEP operating system and its runtime environments, which influenced macOS. This metadata is used by the Objective-C runtime for dynamic features like class information.
- const_data
- A section in an executable or object file typically used to store read-only, constant data, such as string literals or initialized global variables.
- Linker-visible
- A symbol that is made visible to the linker, meaning it can be referenced by other object files during the linking process. This is crucial for functions, variables, or metadata that need to be shared across different compilation units.
- Objective-C runtime
- The runtime system for the Objective-C programming language, which provides dynamic features like message sending, dynamic typing, and runtime class manipulation.
- PR 124260
- Problem Report number 124260 in the GCC bug tracking system, related to issues with handling NeXT metadata on Darwin.