GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
darwin

Darwin: Make all string constant labels linker-visible.

Darwin backend makes all string constants linker-visible, improving consistency with other platforms like aarch64.

The Darwin backend for GCC now makes all string constant labels linker-visible, a change that aligns its behavior with the aarch64 strategy and aims for greater consistency. While this may result in a slight efficiency loss for x86_64, it addresses issues related to the linker visibility of string constants, as reported in PR126723. This ensures that string literals are reliably available to the linker.

In Details

This commit (1c03a15e0979c76a33276cbf498379084896cd06) modifies darwin_encode_section_info in config/darwin.cc to ensure all string constant labels, and const section anchors, are emitted with linker-visibility. This change is motivated by PR126723 and aims to provide a more conservative and consistent behavior across different architectures targeting Darwin, similar to the approach taken for aarch64, even at a minor performance cost on x86_64.

For Context
linker-visibility
A property of symbols that determines whether they are visible to the linker and can be referenced by other object files or libraries. Controls symbol resolution and potential name clashes.
string constant
A literal string value embedded directly within the program's code or data segment, often stored in a read-only section.
PR126723
A problem report filed against GCC, indicating a bug or issue that this commit aims to resolve.
aarch64
A 64-bit ARM architecture, widely used in mobile devices and increasingly in servers and desktops.
x86_64
A 64-bit x86 architecture, dominant in desktop and server computing.
Filed Under: darwinlinkerstrings