mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Have the ELF symbol predicates match more directly the spec.
The underlaying issues is that this code can't really know if an OS specific or processor specific section number should return true or false. One option would be to assert or return an error, but that looks like over engineering since extensions are not that common. It seems better to have these be direct implementation of the ELF spec so that they are natural for someone familiar with ELF reading the code. Code that does have to handle OS/Architecture specific values can do it at a higher level. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239618 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -184,10 +184,7 @@ struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
|
||||
bool isCommon() const {
|
||||
return getType() == ELF::STT_COMMON || st_shndx == ELF::SHN_COMMON;
|
||||
}
|
||||
bool isDefined() const {
|
||||
return !isUndefined() &&
|
||||
!(st_shndx >= ELF::SHN_LORESERVE && st_shndx < ELF::SHN_ABS);
|
||||
}
|
||||
bool isDefined() const { return !isUndefined(); }
|
||||
bool isProcessorSpecific() const {
|
||||
return st_shndx >= ELF::SHN_LOPROC && st_shndx <= ELF::SHN_HIPROC;
|
||||
}
|
||||
@@ -195,7 +192,7 @@ struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
|
||||
return st_shndx >= ELF::SHN_LOOS && st_shndx <= ELF::SHN_HIOS;
|
||||
}
|
||||
bool isReserved() const {
|
||||
return st_shndx > ELF::SHN_HIOS && st_shndx < ELF::SHN_ABS;
|
||||
return st_shndx >= ELF::SHN_LORESERVE && st_shndx <= ELF::SHN_HIRESERVE;
|
||||
}
|
||||
bool isUndefined() const { return st_shndx == ELF::SHN_UNDEF; }
|
||||
};
|
||||
|
Reference in New Issue
Block a user