]> git.ipfire.org Git - thirdparty/gcc.git/commit
Darwin: Anchor block internal symbols must not be linker-visible.
authorIain Sandoe <iain@sandoe.co.uk>
Thu, 7 Aug 2025 16:51:14 +0000 (17:51 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 9 Aug 2025 14:13:30 +0000 (15:13 +0100)
commite38a8582d5b490976e72b7dbcd388e6b81f338c0
tree9b6d3c953001576d51327e6c5be519643bc78bbf
parentd950ba6e51b56adf72e45c58067291be4e0b6785
Darwin: Anchor block internal symbols must not be linker-visible.

When we are using section anchors, there's a requirement that the
sequence of the content is an unbroken block.  If we allow linker-
visible symbols in that block, ld(64) would be able to break it
into sub-sections on those symbol boundaries.

Do not allow symbols that should be visible to be anchored.
Do not make anchor block internal symbols linker-visible.

gcc/ChangeLog:

* config/darwin.cc (darwin_encode_section_info): Do not
make anchored symbols linker-visible.
(darwin_use_anchors_for_symbol_p): Disallow anchoring on
symbols that must be linker-visible (or external), even
if the definitions are in this TU.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/config/darwin.cc