[PATCH] D130451: [JITLink][COFF][x86_64] Stub SECREL relocation to external symbol.

Sunho Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 24 19:03:24 PDT 2022


sunho created this revision.
sunho added reviewers: lhames, sgraenitz.
Herald added subscribers: jsji, StephenFan, hiraditya.
Herald added a project: All.
sunho requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Stubs SECREL relocation to external symbol. In order to correctly deal with this, we want to requrest memory manager to keep track of address of first block of sepecific section and keep address to be only increased from that point. We also should give jitlink to get information about global section. The relocation is only used for debug and tls info which we don't support yet anyways, so just stubbing it for now.


https://reviews.llvm.org/D130451

Files:
  llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp


Index: llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
+++ llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
@@ -132,6 +132,9 @@
       break;
     }
     case COFF::RelocationTypeAMD64::IMAGE_REL_AMD64_SECREL: {
+      // FIXME: SECREL to external symbol should be handled
+      if (!GraphSymbol->isDefined())
+        return Error::success();
       Kind = EdgeKind_coff_x86_64::SecRel32;
       Addend = *reinterpret_cast<const support::little32_t *>(FixupPtr);
       break;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130451.447171.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220725/54b953f6/attachment.bin>


More information about the llvm-commits mailing list