[llvm] [ORC] Add absoluteSymbolsObjectLayer to expose absolute symbols to platform (PR #77008)

Ben Langmuir via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 13:28:55 PST 2024


================
@@ -850,5 +866,41 @@ void EHFrameRegistrationPlugin::notifyTransferringResources(
   }
 }
 
+std::unique_ptr<MaterializationUnit>
+absoluteSymbolsObjectLayer(ObjectLinkingLayer &OLL, SymbolMap Symbols) {
+  const Triple &TT = OLL.getExecutionSession().getTargetTriple();
+  unsigned PointerSize;
+  endianness Endianness =
+      TT.isLittleEndian() ? endianness::little : endianness::big;
+  switch (TT.getArch()) {
+  case Triple::aarch64:
+  case llvm::Triple::riscv64:
+  case Triple::x86_64:
+    PointerSize = 8;
----------------
benlangmuir wrote:

Not thrilled with this, but didn't see an existing method for calculating pointer size for the execution session/target.

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


More information about the llvm-commits mailing list