mirror of
https://github.com/apple/swift.git
synced 2026-10-24 20:15:56 +02:00
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.