mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Make computeSymbolSizes never fail.
On ELF that was already the case since getting the size of a symbol never fails. On MachO and COFF we could fail trying to get the section of a symbol. But we don't really need the section, just the section number to know if two symbols are in the same section or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240580 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -483,6 +483,12 @@ std::error_code MachOObjectFile::getSymbolSection(DataRefImpl Symb,
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
unsigned MachOObjectFile::getSymbolSectionID(SymbolRef Sym) const {
|
||||
MachO::nlist_base Entry =
|
||||
getSymbolTableEntryBase(this, Sym.getRawDataRefImpl());
|
||||
return Entry.n_sect - 1;
|
||||
}
|
||||
|
||||
void MachOObjectFile::moveSectionNext(DataRefImpl &Sec) const {
|
||||
Sec.d.a++;
|
||||
}
|
||||
@ -559,6 +565,10 @@ bool MachOObjectFile::isSectionBSS(DataRefImpl Sec) const {
|
||||
SectionType == MachO::S_GB_ZEROFILL);
|
||||
}
|
||||
|
||||
unsigned MachOObjectFile::getSectionID(SectionRef Sec) const {
|
||||
return Sec.getRawDataRefImpl().d.a;
|
||||
}
|
||||
|
||||
bool MachOObjectFile::isSectionVirtual(DataRefImpl Sec) const {
|
||||
// FIXME: Unimplemented.
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user