[llvm] 87d9048 - Revert "[RuntimeDyld][Windows] Allocate space for dllimport things." (#106954)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 02:27:33 PDT 2024


Author: Alastair Houghton
Date: 2024-09-02T10:27:28+01:00
New Revision: 87d904871fe96a01dfa1f254ca2a7639de67960c

URL: https://github.com/llvm/llvm-project/commit/87d904871fe96a01dfa1f254ca2a7639de67960c
DIFF: https://github.com/llvm/llvm-project/commit/87d904871fe96a01dfa1f254ca2a7639de67960c.diff

LOG: Revert "[RuntimeDyld][Windows] Allocate space for dllimport things." (#106954)

Looks like I missed an `override` (maybe that warning was enabled recently?). Will revert and fix.

Reverts llvm/llvm-project#102586

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
    llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
    llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h
    llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 5ac5532705dc49..7eb7da0138c972 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -690,12 +690,9 @@ unsigned RuntimeDyldImpl::computeSectionStubBufSize(const ObjectFile &Obj,
     if (!(RelSecI == Section))
       continue;
 
-    for (const RelocationRef &Reloc : SI->relocations()) {
+    for (const RelocationRef &Reloc : SI->relocations())
       if (relocationNeedsStub(Reloc))
         StubBufSize += StubSize;
-      if (relocationNeedsDLLImportStub(Reloc))
-        StubBufSize = sizeAfterAddingDLLImportStub(StubBufSize);
-    }
   }
 
   // Get section data size and alignment

diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
index 73b37ee0ff3311..25a2d8780fb56c 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
@@ -119,14 +119,4 @@ bool RuntimeDyldCOFF::isCompatibleFile(const object::ObjectFile &Obj) const {
   return Obj.isCOFF();
 }
 
-bool RuntimeDyldCOFF::relocationNeedsDLLImportStub(
-    const RelocationRef &R) const {
-  object::symbol_iterator Symbol = R.getSymbol();
-  Expected<StringRef> TargetNameOrErr = Symbol->getName();
-  if (!TargetNameOrErr)
-    return false;
-
-  return TargetNameOrErr->starts_with(getImportSymbolPrefix());
-}
-
 } // namespace llvm

diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h
index 51d177c7bb8bec..25e3783cf160b2 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h
@@ -14,7 +14,6 @@
 #define LLVM_RUNTIME_DYLD_COFF_H
 
 #include "RuntimeDyldImpl.h"
-#include "llvm/Support/MathExtras.h"
 
 namespace llvm {
 
@@ -46,12 +45,6 @@ class RuntimeDyldCOFF : public RuntimeDyldImpl {
 
   static constexpr StringRef getImportSymbolPrefix() { return "__imp_"; }
 
-  bool relocationNeedsDLLImportStub(const RelocationRef &R) const;
-
-  unsigned sizeAfterAddingDLLImportStub(unsigned Size) const {
-    return alignTo(Size, PointerSize) + PointerSize;
-  }
-
 private:
   unsigned PointerSize;
   uint32_t PointerReloc;

diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index de7630b9747ea4..e09c632842d6e9 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -455,16 +455,6 @@ class RuntimeDyldImpl {
     return true;    // Conservative answer
   }
 
-  // Return true if the relocation R may require allocating a DLL import stub.
-  virtual bool relocationNeedsDLLImportStub(const RelocationRef &R) const {
-    return false;
-  }
-
-  // Add the size of a DLL import stub to the buffer size
-  virtual unsigned sizeAfterAddingDLLImportStub(unsigned Size) const {
-    return Size;
-  }
-
 public:
   RuntimeDyldImpl(RuntimeDyld::MemoryManager &MemMgr,
                   JITSymbolResolver &Resolver)


        


More information about the llvm-commits mailing list