diff options
author | Danil Malyshev <dmalyshev@accesssoftek.com> | 2011-11-29 17:40:10 +0000 |
---|---|---|
committer | Danil Malyshev <dmalyshev@accesssoftek.com> | 2011-11-29 17:40:10 +0000 |
commit | b0436a73054fe676b216a0cf872d1fc433125c62 (patch) | |
tree | e563af80f77645faaa3f82c5026a50d46da03047 /lib/Object/Object.cpp | |
parent | f68b214e2d06849091b5ff3dd5d5efe29722dcc3 (diff) | |
download | external_llvm-b0436a73054fe676b216a0cf872d1fc433125c62.zip external_llvm-b0436a73054fe676b216a0cf872d1fc433125c62.tar.gz external_llvm-b0436a73054fe676b216a0cf872d1fc433125c62.tar.bz2 |
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@145408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/Object.cpp')
-rw-r--r-- | lib/Object/Object.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Object/Object.cpp b/lib/Object/Object.cpp index 719bf88..f061ea7 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)) |