summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Object.cpp
diff options
context:
space:
mode:
authorDanil Malyshev <dmalyshev@accesssoftek.com>2011-11-29 17:40:10 +0000
committerDanil Malyshev <dmalyshev@accesssoftek.com>2011-11-29 17:40:10 +0000
commitcbe72fc9591d4d5e232221bfe5c391f5eb18e126 (patch)
treef930d13d3db68296cf2fd29fdc334f31097649f6 /llvm/lib/Object/Object.cpp
parentab4f438239424dd39b83338ab0b4faa41245e506 (diff)
downloadbcm5719-llvm-cbe72fc9591d4d5e232221bfe5c391f5eb18e126.tar.gz
bcm5719-llvm-cbe72fc9591d4d5e232221bfe5c391f5eb18e126.zip
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. llvm-svn: 145408
Diffstat (limited to 'llvm/lib/Object/Object.cpp')
-rw-r--r--llvm/lib/Object/Object.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Object/Object.cpp b/llvm/lib/Object/Object.cpp
index 719bf882f22..f061ea7cebe 100644
--- a/llvm/lib/Object/Object.cpp
+++ b/llvm/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))
OpenPOWER on IntegriCloud