Skip to content

Commit 87d9048

Browse files
authored
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 #102586
1 parent eaea4d1 commit 87d9048

File tree

4 files changed

+1
-31
lines changed

4 files changed

+1
-31
lines changed

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,9 @@ unsigned RuntimeDyldImpl::computeSectionStubBufSize(const ObjectFile &Obj,
690690
if (!(RelSecI == Section))
691691
continue;
692692

693-
for (const RelocationRef &Reloc : SI->relocations()) {
693+
for (const RelocationRef &Reloc : SI->relocations())
694694
if (relocationNeedsStub(Reloc))
695695
StubBufSize += StubSize;
696-
if (relocationNeedsDLLImportStub(Reloc))
697-
StubBufSize = sizeAfterAddingDLLImportStub(StubBufSize);
698-
}
699696
}
700697

701698
// Get section data size and alignment

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,4 @@ bool RuntimeDyldCOFF::isCompatibleFile(const object::ObjectFile &Obj) const {
119119
return Obj.isCOFF();
120120
}
121121

122-
bool RuntimeDyldCOFF::relocationNeedsDLLImportStub(
123-
const RelocationRef &R) const {
124-
object::symbol_iterator Symbol = R.getSymbol();
125-
Expected<StringRef> TargetNameOrErr = Symbol->getName();
126-
if (!TargetNameOrErr)
127-
return false;
128-
129-
return TargetNameOrErr->starts_with(getImportSymbolPrefix());
130-
}
131-
132122
} // namespace llvm

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define LLVM_RUNTIME_DYLD_COFF_H
1515

1616
#include "RuntimeDyldImpl.h"
17-
#include "llvm/Support/MathExtras.h"
1817

1918
namespace llvm {
2019

@@ -46,12 +45,6 @@ class RuntimeDyldCOFF : public RuntimeDyldImpl {
4645

4746
static constexpr StringRef getImportSymbolPrefix() { return "__imp_"; }
4847

49-
bool relocationNeedsDLLImportStub(const RelocationRef &R) const;
50-
51-
unsigned sizeAfterAddingDLLImportStub(unsigned Size) const {
52-
return alignTo(Size, PointerSize) + PointerSize;
53-
}
54-
5548
private:
5649
unsigned PointerSize;
5750
uint32_t PointerReloc;

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,6 @@ class RuntimeDyldImpl {
455455
return true; // Conservative answer
456456
}
457457

458-
// Return true if the relocation R may require allocating a DLL import stub.
459-
virtual bool relocationNeedsDLLImportStub(const RelocationRef &R) const {
460-
return false;
461-
}
462-
463-
// Add the size of a DLL import stub to the buffer size
464-
virtual unsigned sizeAfterAddingDLLImportStub(unsigned Size) const {
465-
return Size;
466-
}
467-
468458
public:
469459
RuntimeDyldImpl(RuntimeDyld::MemoryManager &MemMgr,
470460
JITSymbolResolver &Resolver)

0 commit comments

Comments
 (0)