[llvm] 9381de0 - [JITLink][COFF][x86_64] Stub SECREL relocation to external symbol.

Sunho Kim via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 23:13:45 PDT 2022


Author: Sunho Kim
Date: 2022-08-11T15:12:25+09:00
New Revision: 9381de09526104fd08d0eef03032d6fbe491b9d1

URL: https://github.com/llvm/llvm-project/commit/9381de09526104fd08d0eef03032d6fbe491b9d1
DIFF: https://github.com/llvm/llvm-project/commit/9381de09526104fd08d0eef03032d6fbe491b9d1.diff

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

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.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130451

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp b/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
index 4756cb8a7cbd..88fc6b98ab9c 100644
--- a/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp
@@ -161,6 +161,9 @@ class COFFLinkGraphBuilder_x86_64 : public COFFLinkGraphBuilder {
       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;


        


More information about the llvm-commits mailing list