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

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 11:40:13 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;
----------------
lhames wrote:

Yeah -- I don't think this is a blocker here.

I think the triple was added to the `LinkGraph` after the pointer-size / endianness pair, but now that we have the triple the pointer-size and endianness seem redundant -- is there any situation where we _can't_ derive them from the triple? Maybe we can just get rid of them in a follow-up patch.

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


More information about the llvm-commits mailing list