MachO: re-enable writing of compact-unwind sections.
This isn't really the right place to put them in final object files (that would
be __TEXT,__unwind_info), but the format is different between relocatable and
final objects, which means we really need a pass to handle the translation.
For now, re-emitting in __LD,__compact_unwind is harmless (dyld ignores it and
moves straight on to inspecting __TEXT,__eh_frame), and sidesteps an assertion
failure when processing files containing compact-unwind info.
llvm-svn: 212032
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
index ad45bac..5bc1b3d 100644
--- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
+++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
@@ -215,7 +215,13 @@
typeTerminatorPtr),
ENTRY("__DATA", "___got", S_NON_LAZY_SYMBOL_POINTERS,
typeGOT),
- ENTRY("__DATA", "___bss", S_ZEROFILL, typeZeroFill)
+ ENTRY("__DATA", "___bss", S_ZEROFILL, typeZeroFill),
+
+ // FIXME: __compact_unwind actually needs to be processed by a pass and put
+ // into __TEXT,__unwind_info. For now, forwarding it back to
+ // __LD,__compact_unwind is harmless (it's ignored by the unwinder, which then
+ // proceeds to process __TEXT,__eh_frame for its instructions).
+ ENTRY("__LD", "__compact_unwind", S_REGULAR, typeCompactUnwindInfo),
};
#undef ENTRY