[JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings.
authorLang Hames <lhames@gmail.com>
Wed, 9 Jun 2021 08:56:30 +0000 (18:56 +1000)
committerLang Hames <lhames@gmail.com>
Wed, 9 Jun 2021 09:16:49 +0000 (19:16 +1000)
commit82f8aef3deb196ad323a3ef57c03276c6e93a246
tree24ad279a9858006500d9b024eab7cec20cbe00d8
parente978f6bc97064603a5665a6797d6e613a231479a
[JITLink][MachO] Handle muliple symbols at same offset when splitting C-strings.

The C-string section splitting support added in f9649d123db triggered an assert
("Duplicate canonical symbol at address") when multiple symbols were defined at
the the same offset within a C-string block (this triggered on arm64, where we
always add a block start symbol). The bug was caused by a failure to update the
record of the last canonical symbol address. The fix was to maintain this record
correctly, and move the auto-generation of the block-start symbol above the
handling for symbols defined in the object itself so that all symbols
(auto-generated and defined) are processed in address order.
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp