mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Common symbols don't have a value.
At least not in the interface exposed by ObjectFile. This matches what ELF and COFF implement. Adjust existing code that was expecting them to have values. No overall functionality change intended. Another option would be to change the interface and the ELF and COFF implementations to say that the value of a common symbol is its size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -369,11 +369,10 @@ std::error_code MachOObjectFile::getIndirectName(DataRefImpl 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)
|
||||
if ((Entry.n_type & MachO::N_TYPE) == MachO::N_UNDF)
|
||||
return UnknownAddress;
|
||||
return NValue;
|
||||
return getNValue(Sym);
|
||||
}
|
||||
|
||||
ErrorOr<uint64_t> MachOObjectFile::getSymbolAddress(DataRefImpl Sym) const {
|
||||
|
Reference in New Issue
Block a user