aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
commit1a82d4c088707c791c792f6822f611b47a12bdfe (patch)
tree7c411f9b5d807f7f204fdd16965d8925a82b6d18 /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
parent3a0822f094b578157263e04114075ad7df81db41 (diff)
Notes
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
index 9f80e5a87cd0..1dacc1393f2c 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldCOFF.cpp
@@ -36,7 +36,7 @@ public:
return OwningBinary<ObjectFile>();
}
};
-} // namespace
+}
namespace llvm {
@@ -62,23 +62,8 @@ RuntimeDyldCOFF::loadObject(const object::ObjectFile &O) {
}
uint64_t RuntimeDyldCOFF::getSymbolOffset(const SymbolRef &Sym) {
- uint64_t Address;
- if (Sym.getAddress(Address))
- return UnknownAddressOrSize;
-
- if (Address == UnknownAddressOrSize)
- return UnknownAddressOrSize;
-
- const ObjectFile *Obj = Sym.getObject();
- section_iterator SecI(Obj->section_end());
- if (Sym.getSection(SecI))
- return UnknownAddressOrSize;
-
- if (SecI == Obj->section_end())
- return UnknownAddressOrSize;
-
- uint64_t SectionAddress = SecI->getAddress();
- return Address - SectionAddress;
+ // The value in a relocatable COFF object is the offset.
+ return Sym.getValue();
}
bool RuntimeDyldCOFF::isCompatibleFile(const object::ObjectFile &Obj) const {