[BOLT] Split functions with exceptions in shared objects and PIEs
authorMaksim Panchenko <maks@fb.com>
Thu, 10 Mar 2022 20:08:57 +0000 (12:08 -0800)
committerMaksim Panchenko <maks@fb.com>
Sun, 19 Jun 2022 23:48:48 +0000 (16:48 -0700)
commitf263a66ba0125f4fbe06c0a5e0b0c193998b74db
treedde3eee3d69111dfb612e623270c2f44671a723e
parentcc65f3e167144c39ef9ca3a69c3148b71dcab496
[BOLT] Split functions with exceptions in shared objects and PIEs

Add functionality to allow splitting code with C++ exceptions in shared
libraries and PIEs. To overcome a limitation in exception ranges format,
for functions with fragments spanning multiple sections, add trampoline
landing pads in the same section as the corresponding throwing range.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D127936
bolt/include/bolt/Core/MCPlusBuilder.h
bolt/include/bolt/Passes/SplitFunctions.h
bolt/lib/Core/BinaryEmitter.cpp
bolt/lib/Core/MCPlusBuilder.cpp
bolt/lib/Passes/SplitFunctions.cpp
bolt/lib/Rewrite/RewriteInstance.cpp
bolt/test/runtime/X86/Inputs/exceptions_split.cpp
bolt/test/runtime/X86/pie-exceptions-split.test [new file with mode: 0644]