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
This commit is contained in:
Danil Malyshev
2011-11-27 10:12:52 +00:00
parent 2eb5a744b1
commit 9b24738bd1
11 changed files with 150 additions and 44 deletions

View File

@@ -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))