Files
zig/src
Matthew Lugg fca3f6f62e MachO: don't split subsections on N_ALT_ENTRY symbols
MachO has a mechanism where symbols can introduce "subsections", which
(as I understand it) allows a linker to garbage-collect parts of
sections without pulling in the heavy machinery of `-fdata-sections` and
`-ffunction-sections`. Essentially, symbols can be considered to
partition a section, and these boundaries are not allowed to be crossed
by memory accesses, so the linker can detect symbols which are unused
and drop the corresponding input section regions.

However, the symbol flag `N_ALT_ENTRY` indicates that a symbol should
not participate in this "splitting", and is instead an "alternate entry
point" to the previous subsection, which should continue through this
symbol.

The Mach-O linker was failing to ignore `N_ALT_ENTRY` symbols when
creating subsections, which meant that for certain link inputs, it would
create additional subsection splits, and then garbage collect the extra
sections (due to the `N_ALT_ENTRY` symbol being unused). Naturally, this
silent dropping of parts of input sections led to miscompilations.
2026-03-28 16:50:43 +00:00
..
2026-03-28 16:50:42 +00:00
2026-03-17 23:33:10 +01:00
2026-03-28 16:50:42 +00:00
2026-03-15 11:47:14 +00:00
2025-10-29 14:25:51 +01:00
2026-02-09 10:47:21 -05:00
2026-03-15 11:47:14 +00:00
2026-03-10 10:26:07 +00:00
2025-08-29 17:14:26 -07:00
2026-03-28 16:50:42 +00:00
2026-02-09 10:47:21 -05:00
2026-03-28 16:45:55 +00:00
2026-03-28 16:50:42 +00:00