[llvm] [JITLink][AArch32] Implement R_ARM_PREL31 and process .ARM.exidx sections (PR #79044)

Stefan Gränitz via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 11:59:11 PST 2024


================
@@ -397,6 +397,11 @@ template <typename ELFT> Error ELFLinkGraphBuilder<ELFT>::graphifySections() {
                                   orc::ExecutorAddr(Sec.sh_addr),
                                   Sec.sh_addralign, 0);
 
+    if (Sec.sh_type == ELF::SHT_ARM_EXIDX) {
+      // Add live symbol to avoid dead-stripping for .ARM.exidx sections
+      G->addAnonymousSymbol(*B, orc::ExecutorAddrDiff(), orc::ExecutorAddrDiff(), false, true);
----------------
weliveindetail wrote:

The compiler emits a `R_ARM_NONE` relocation from an exception-handling table section to the required personality routine to indicate the dependence, but the edge alone doesn't keep the section alive in JITLink. We add the anonymous live symbol here to preserve it from dead-stripping.

https://github.com/llvm/llvm-project/pull/79044


More information about the llvm-commits mailing list