This is the initial patch of the unwinder for IBM AIX.
- AIX does not support the eh_frame section. Instead, the traceback table located at the end each function provides the information for stack unwinding and EH. In this patch macro _LIBUNWIND_SUPPORT_TBTAB_UNWIND is used to guard code for AIX traceback table based unwinding. Function getInfoFromTBTable() and stepWithTBTable() are added to get the EH information from the traceback table and to step up the stack respectively.
- This patch supports two kinds of LSDA information for EH on AIX, the state table and the range table. The state table is used by the previous version of the IBM XL compiler, i.e., xlclang++. The DWARF based range table is used by AIX clang++. The traceback table has flags to differentiate these cases. For the range table, relative addresses are calculated using a base of DW_EH_PE_datarel, which is the TOC base of the module where the function of the current frame belongs.
- Two personality routines are employed to handle these two different LSDAs, __xlcxx_personality_v0() for the state table and __xlcxx_personality_v1() for the range table. Since the traceback table does not have the information of the personality for the state table approach, its personality __xlcxx_personality_v0() is directly assigned as the handler for the state table. For the range table, the locations of the LSDA and its associated personality routine are found in the traceback table.
- Assembly code for 32- and 64-bit PowerPC in UnwindRegistersRestore.S and UnwindRegistersSave.S are modified so that it can be consumed by the GNU flavor assembler and the AIX assembler. The restoration of vector registers does not check VRSAVE because in the AIX ABI, VRSAVE is not used.
- Changes in libcxxabi for the AIX EH will be in a separate patch, https://reviews.llvm.org/D100504.
- No issues were found running tests of the libunwind and libcxxabi test suites, except some test cases of libunwind needs to be excluded for AIX and there are 7 libcxxabi test cases failing at the compile time. The LIT test will be addressed once the packaging of runtime libraries and the compiler for AIX is finalized.