mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
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
This commit is contained in:
@@ -419,7 +419,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
|
||||
// Start at the address of the symbol relative to the section's address.
|
||||
uint64_t Start = 0;
|
||||
Symbols[SymIdx].getOffset(Start);
|
||||
Symbols[SymIdx].getAddress(Start);
|
||||
|
||||
// Stop disassembling either at the beginning of the next symbol or at
|
||||
// the end of the section.
|
||||
@@ -432,7 +432,7 @@ void llvm::DisassembleInputMachO(StringRef Filename) {
|
||||
if (NextSymType == SymbolRef::ST_Function) {
|
||||
Sections[SectIdx].containsSymbol(Symbols[NextSymIdx],
|
||||
containsNextSym);
|
||||
Symbols[NextSymIdx].getOffset(NextSym);
|
||||
Symbols[NextSymIdx].getAddress(NextSym);
|
||||
break;
|
||||
}
|
||||
++NextSymIdx;
|
||||
|
@@ -186,7 +186,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
|
||||
bool contains;
|
||||
if (!error(i->containsSymbol(*si, contains)) && contains) {
|
||||
uint64_t Address;
|
||||
if (error(si->getOffset(Address))) break;
|
||||
if (error(si->getAddress(Address))) break;
|
||||
StringRef Name;
|
||||
if (error(si->getName(Name))) break;
|
||||
Symbols.push_back(std::make_pair(Address, Name));
|
||||
@@ -477,7 +477,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
|
||||
se = o->end_symbols(); si != se; si.increment(ec)) {
|
||||
if (error(ec)) return;
|
||||
StringRef Name;
|
||||
uint64_t Offset;
|
||||
uint64_t Address;
|
||||
bool Global;
|
||||
SymbolRef::Type Type;
|
||||
bool Weak;
|
||||
@@ -485,7 +485,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
|
||||
uint64_t Size;
|
||||
section_iterator Section = o->end_sections();
|
||||
if (error(si->getName(Name))) continue;
|
||||
if (error(si->getOffset(Offset))) continue;
|
||||
if (error(si->getAddress(Address))) continue;
|
||||
if (error(si->isGlobal(Global))) continue;
|
||||
if (error(si->getType(Type))) continue;
|
||||
if (error(si->isWeak(Weak))) continue;
|
||||
@@ -493,8 +493,10 @@ static void PrintSymbolTable(const ObjectFile *o) {
|
||||
if (error(si->getSize(Size))) continue;
|
||||
if (error(si->getSection(Section))) continue;
|
||||
|
||||
if (Offset == UnknownAddressOrSize)
|
||||
Offset = 0;
|
||||
if (Address == UnknownAddressOrSize)
|
||||
Address = 0;
|
||||
if (Size == UnknownAddressOrSize)
|
||||
Size = 0;
|
||||
char GlobLoc = ' ';
|
||||
if (Type != SymbolRef::ST_External)
|
||||
GlobLoc = Global ? 'g' : 'l';
|
||||
@@ -506,7 +508,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
|
||||
else if (Type == SymbolRef::ST_Function)
|
||||
FileFunc = 'F';
|
||||
|
||||
outs() << format("%08"PRIx64, Offset) << " "
|
||||
outs() << format("%08"PRIx64, Address) << " "
|
||||
<< GlobLoc // Local -> 'l', Global -> 'g', Neither -> ' '
|
||||
<< (Weak ? 'w' : ' ') // Weak?
|
||||
<< ' ' // Constructor. Not supported yet.
|
||||
|
Reference in New Issue
Block a user