Skip to content

Commit

Permalink
Revert "[RuntimeDyld][Windows] Allocate space for dllimport things." (l…
Browse files Browse the repository at this point in the history
…lvm#106954)

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

Reverts llvm#102586
  • Loading branch information
al45tair authored Sep 2, 2024
1 parent eaea4d1 commit 87d9048
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 31 deletions.
5 changes: 1 addition & 4 deletions llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 0 additions & 7 deletions llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define LLVM_RUNTIME_DYLD_COFF_H

#include "RuntimeDyldImpl.h"
#include "llvm/Support/MathExtras.h"

namespace llvm {

Expand Down Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 87d9048

Please sign in to comment.