Files
Dario Rexin f835f0aa63 [IRGen] Collocate dynamic-replacement functions into the primary module under multi-threaded WMO
rdar://187511655

Under multi-threaded WMO the dynamic-replacements table is emitted into the
primary IGM and references each replacement function with a direct
(subtraction-based) relative pointer. The replacement function itself was
emitted into its own source file's IGM, i.e. a different object file, so the
reference crossed an object-file boundary. On x86_64 Mach-O that is an
undefined minuend in an X86_64_RELOC_SUBTRACTOR: older assemblers silently
wrote a bogus offset, newer ones reject it outright ("could not emit object
file: the LLVM backend reported an error").

Force every @_dynamicReplacement function into the primary IGM before function
emission, mirroring the existing witness-table collocation, so the table's
direct relative reference stays within one object.
2026-09-25 11:24:44 +01:00
..