mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
Add a SymbolRef::getValue.
This returns either the symbol offset or address. Since it is not defined which one, it never has to lookup the section and so never fails. I will add users in the next commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240569 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -370,14 +370,17 @@ std::error_code MachOObjectFile::getIndirectName(DataRefImpl Symb,
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Symb,
|
||||
uint64_t &Res) const {
|
||||
uint64_t NValue = getNValue(Symb);
|
||||
MachO::nlist_base Entry = getSymbolTableEntryBase(this, Symb);
|
||||
uint64_t MachOObjectFile::getSymbolValue(DataRefImpl Sym) const {
|
||||
uint64_t NValue = getNValue(Sym);
|
||||
MachO::nlist_base Entry = getSymbolTableEntryBase(this, Sym);
|
||||
if ((Entry.n_type & MachO::N_TYPE) == MachO::N_UNDF && NValue == 0)
|
||||
Res = UnknownAddress;
|
||||
else
|
||||
Res = NValue;
|
||||
return UnknownAddress;
|
||||
return NValue;
|
||||
}
|
||||
|
||||
std::error_code MachOObjectFile::getSymbolAddress(DataRefImpl Sym,
|
||||
uint64_t &Res) const {
|
||||
Res = getSymbolValue(Sym);
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user