aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/Object.cpp
diff options
context:
space:
mode:
authorDanil Malyshev <dmalyshev@accesssoftek.com>2011-11-27 10:12:52 +0000
committerDanil Malyshev <dmalyshev@accesssoftek.com>2011-11-27 10:12:52 +0000
commit9b24738bd1dc791eb2c21b5562fcfe4b7b99fe2a (patch)
tree0b6229146897c4132df67e8ea79605ba3a4a0885 /lib/Object/Object.cpp
parent2eb5a744b18d429928751b06e205cbb88f668ae7 (diff)
Fixed ObjectFile functions:
- getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/Object.cpp')
-rw-r--r--lib/Object/Object.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Object/Object.cpp b/lib/Object/Object.cpp
index 719bf882f2..f061ea7ceb 100644
--- a/lib/Object/Object.cpp
+++ b/lib/Object/Object.cpp
@@ -150,9 +150,9 @@ uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI) {
return ret;
}
-uint64_t LLVMGetSymbolOffset(LLVMSymbolIteratorRef SI) {
+uint64_t LLVMGetSymbolFileOffset(LLVMSymbolIteratorRef SI) {
uint64_t ret;
- if (error_code ec = (*unwrap(SI))->getOffset(ret))
+ if (error_code ec = (*unwrap(SI))->getFileOffset(ret))
report_fatal_error(ec.message());
return ret;
}
@@ -172,6 +172,13 @@ uint64_t LLVMGetRelocationAddress(LLVMRelocationIteratorRef RI) {
return ret;
}
+uint64_t LLVMGetRelocationOffset(LLVMRelocationIteratorRef RI) {
+ uint64_t ret;
+ if (error_code ec = (*unwrap(RI))->getOffset(ret))
+ report_fatal_error(ec.message());
+ return ret;
+}
+
LLVMSymbolIteratorRef LLVMGetRelocationSymbol(LLVMRelocationIteratorRef RI) {
SymbolRef ret;
if (error_code ec = (*unwrap(RI))->getSymbol(ret))