This patch contains the implementation 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., xlC and 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 dynamically resolved as 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 is in a separate patch D100504.
- No issues were found running libunwind and libcxxabi LIT tests. LIT test cases have been added for code specific to AIX unwinding.
Should we consider just padding on clang instead of having a 1-entry difference on clang and gcc?