llvm_unreachable("invalid symbol kind");
}
-SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
- uint8_t Type)
- : SymbolKind(K), IsLocal(IsLocal), NeedsPltAddr(false),
- IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false),
- IsInIgot(false), IsPreemptible(false), Type(Type), StOther(StOther),
- Name(Name) {}
-
// Returns true if this is a weak undefined symbol.
bool SymbolBody::isUndefWeak() const {
// See comment on Lazy in Symbols.h for the details.
Verstr);
}
-Defined::Defined(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
- uint8_t Type)
- : SymbolBody(K, Name, IsLocal, StOther, Type) {}
-
template <class ELFT> bool DefinedRegular::isMipsPIC() const {
typedef typename ELFT::Ehdr Elf_Ehdr;
if (!Section || !isFunc())
(Hdr->e_flags & EF_MIPS_PIC);
}
-Undefined::Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther,
- uint8_t Type)
- : SymbolBody(SymbolBody::UndefinedKind, Name, IsLocal, StOther, Type) {}
-
-DefinedCommon::DefinedCommon(StringRef Name, uint64_t Size, uint32_t Alignment,
- uint8_t StOther, uint8_t Type)
- : Defined(SymbolBody::DefinedCommonKind, Name, /*IsLocal=*/false, StOther,
- Type),
- Alignment(Alignment), Size(Size) {}
-
// If a shared symbol is referred via a copy relocation, its alignment
// becomes part of the ABI. This function returns a symbol alignment.
// Because symbols don't have alignment attributes, we need to infer that.
return cast<LazyObject>(this)->fetch();
}
-LazyArchive::LazyArchive(const llvm::object::Archive::Symbol S, uint8_t Type)
- : Lazy(LazyArchiveKind, S.getName(), Type), Sym(S) {}
-
-LazyObject::LazyObject(StringRef Name, uint8_t Type)
- : Lazy(LazyObjectKind, Name, Type) {}
-
ArchiveFile *LazyArchive::getFile() {
return cast<ArchiveFile>(SymbolBody::getFile());
}
protected:
SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
- uint8_t Type);
+ uint8_t Type)
+ : SymbolKind(K), IsLocal(IsLocal), NeedsPltAddr(false),
+ IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false),
+ IsInIgot(false), IsPreemptible(false), Type(Type), StOther(StOther),
+ Name(Name) {}
const unsigned SymbolKind : 8;
// The base class for any defined symbols.
class Defined : public SymbolBody {
public:
- Defined(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther, uint8_t Type);
+ Defined(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther, uint8_t Type)
+ : SymbolBody(K, Name, IsLocal, StOther, Type) {}
+
static bool classof(const SymbolBody *S) { return S->isDefined(); }
};
class DefinedCommon : public Defined {
public:
- DefinedCommon(StringRef N, uint64_t Size, uint32_t Alignment, uint8_t StOther,
- uint8_t Type);
+ DefinedCommon(StringRef Name, uint64_t Size, uint32_t Alignment,
+ uint8_t StOther, uint8_t Type)
+ : Defined(SymbolBody::DefinedCommonKind, Name, /*IsLocal=*/false, StOther,
+ Type),
+ Alignment(Alignment), Size(Size) {}
static bool classof(const SymbolBody *S) {
return S->kind() == SymbolBody::DefinedCommonKind;
class Undefined : public SymbolBody {
public:
- Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther, uint8_t Type);
+ Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther, uint8_t Type)
+ : SymbolBody(SymbolBody::UndefinedKind, Name, IsLocal, StOther, Type) {}
static bool classof(const SymbolBody *S) {
return S->kind() == UndefinedKind;
// symbol.
class LazyArchive : public Lazy {
public:
- LazyArchive(const llvm::object::Archive::Symbol S, uint8_t Type);
+ LazyArchive(const llvm::object::Archive::Symbol S, uint8_t Type)
+ : Lazy(LazyArchiveKind, S.getName(), Type), Sym(S) {}
static bool classof(const SymbolBody *S) {
return S->kind() == LazyArchiveKind;
// --start-lib and --end-lib options.
class LazyObject : public Lazy {
public:
- LazyObject(StringRef Name, uint8_t Type);
+ LazyObject(StringRef Name, uint8_t Type) : Lazy(LazyObjectKind, Name, Type) {}
static bool classof(const SymbolBody *S) {
return S->kind() == LazyObjectKind;