1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00

[Object/ELF] Don't confuse isDefined() and isCommon.

Reported by Rafael Espindola. Pointy-hat to me.

llvm-svn: 239241
This commit is contained in:
Davide Italiano 2015-06-07 02:45:19 +00:00
parent 3a529b818e
commit ca18d50928

View File

@ -180,14 +180,11 @@ struct Elf_Sym_Impl : Elf_Sym_Base<ELFT> {
bool isAbsolute() const { return st_shndx == ELF::SHN_ABS; }
bool isCommon() const {
return !isUndefined() &&
!(st_shndx >= ELF::SHN_LORESERVE && st_shndx < ELF::SHN_ABS);
return getType() == ELF::STT_COMMON || st_shndx == ELF::SHN_COMMON;
}
bool isDefined() const {
return !isUndefined() &&
(!(st_shndx >= ELF::SHN_LORESERVE &&
st_shndx <= ELF::SHN_HIRESERVE) ||
st_shndx == ELF::SHN_XINDEX);
!(st_shndx >= ELF::SHN_LORESERVE && st_shndx < ELF::SHN_ABS);
}
bool isProcessorSpecific() const {
return st_shndx >= ELF::SHN_LOPROC && st_shndx <= ELF::SHN_HIPROC;