[llvm] r239241 - [Object/ELF] Don't confuse isDefined() and isCommon.
Davide Italiano
davide at freebsd.org
Sat Jun 6 19:45:20 PDT 2015
Author: davide
Date: Sat Jun 6 21:45:19 2015
New Revision: 239241
URL: http://llvm.org/viewvc/llvm-project?rev=239241&view=rev
Log:
[Object/ELF] Don't confuse isDefined() and isCommon.
Reported by Rafael Espindola. Pointy-hat to me.
Modified:
llvm/trunk/include/llvm/Object/ELFTypes.h
Modified: llvm/trunk/include/llvm/Object/ELFTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFTypes.h?rev=239241&r1=239240&r2=239241&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/ELFTypes.h (original)
+++ llvm/trunk/include/llvm/Object/ELFTypes.h Sat Jun 6 21:45:19 2015
@@ -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;
More information about the llvm-commits
mailing list