[ORC] Pad section start to account for alignment offset in MachO GDB JIT plugin.
authorLang Hames <lhames@gmail.com>
Tue, 7 Dec 2021 01:22:30 +0000 (12:22 +1100)
committerLang Hames <lhames@gmail.com>
Tue, 7 Dec 2021 03:28:31 +0000 (14:28 +1100)
commit02095f2dd7d96768432af8a53e2d743e881e7447
treea6ebe7a14dd8a34267a1809a488386254a763496
parentce25eb12dd5abae6c769168a70a8f377b608228c
[ORC] Pad section start to account for alignment offset in MachO GDB JIT plugin.

In order to present a well-formed MachO debug object for debugger registration
the first block in each section must have a zero alignment offset (since there
is no way to represent a non-zero offset in a MachO section load command). This
patch updates the MachODebugObjectSynthesizer class to introduce a padding
padding block at the start of the section if necessary to guarantee a zero
alignment offset.
llvm/lib/ExecutionEngine/Orc/DebuggerSupportPlugin.cpp
llvm/test/ExecutionEngine/JITLink/X86/Inputs/MachO_strong_def_extra.s [new file with mode: 0644]
llvm/test/ExecutionEngine/JITLink/X86/MachO_gdb_jit_nonzero_alignment_offsets.s [new file with mode: 0644]