Darwin Objective-C/C++: Globalize protocol reference metadata symbols.
Globalizes protocol reference metadata symbols for newer Darwin static linkers.
Newer versions of the Darwin static linker require global symbols for protocol reference lists. This change ensures that these symbols are globalized, preventing linker errors. The darwin_globalize_label and darwin_label_is_anonymous_local_objc_name functions in config/darwin.cc are updated to handle protocol references.
In Details
This change addresses a linker requirement on Darwin systems where protocol reference metadata symbols must be global. The LLVM static linker, for instance, enforces this by disallowing local symbols for these specific metadata lists. The modifications in config/darwin.cc ensure that such symbols are emitted with global linkage where appropriate, aligning GCC's output with the linker's expectations.
- Protocol reference metadata
- Data associated with Objective-C/C++ protocols that the runtime uses to resolve method calls and other protocol-related operations. These references need specific symbol visibility rules imposed by linkers.
- Static linker
- A program that combines multiple object files and libraries into a single executable or library. It resolves symbol references between them and applies symbol visibility rules.
- Global symbol
- A symbol that is visible and can be referenced by other object files or libraries during the linking process. This contrasts with local symbols, which are typically only visible within their own compilation unit.