[JITLink] Skip debug sections in MachO objects.
authorLang Hames <lhames@gmail.com>
Wed, 3 Jun 2020 04:31:26 +0000 (21:31 -0700)
committerLang Hames <lhames@gmail.com>
Wed, 3 Jun 2020 18:08:14 +0000 (11:08 -0700)
commitd27cbf03cf9c43b4b98f031d63f23cfcfe3d587a
tree98ffad57848c9c111f7af1abff7bc08f701e3259
parent9f8ea2e6cf7c855aa4f89993a6c696390cb07d07
[JITLink] Skip debug sections in MachO objects.

Debug sections will not be linked into the final executable and may contain
ambiguous relocations*. Skipping them avoids both some unnecessary processing
cost and the hassle of dealing with the problematic relocations.

* E.g. __debug_ranges contains non-extern relocations to the end of functions
hat begin with named symbols. Under the usual rules for interpreting non-extern
relocations these will be incorrectly associated with the following block, or
no block at all (if there is a gap between one block and the next).
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
llvm/test/ExecutionEngine/JITLink/X86/MachO_skip_debug_sections.s [new file with mode: 0644]