/// \brief True if this symbol (which is a variable) is weak. This is not
/// just STB_WEAK, but more generally whether or not we can evaluate
/// past it.
- virtual bool isWeak(const MCSymbolData &SD) const;
+ virtual bool isWeak(const MCSymbol &Sym) const;
/// \brief Write the object file.
///
bool InSet,
bool IsPCRel) const override;
- bool isWeak(const MCSymbolData &SD) const override;
+ bool isWeak(const MCSymbol &Sym) const override;
void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) override;
void writeSection(MCAssembler &Asm,
InSet, IsPCRel);
}
-bool ELFObjectWriter::isWeak(const MCSymbolData &SD) const {
+bool ELFObjectWriter::isWeak(const MCSymbol &Sym) const {
+ const MCSymbolData &SD = Sym.getData();
if (::isWeak(SD))
return true;
if (MCELF::GetBinding(SD) != ELF::STB_GLOBAL)
return false;
- const MCSymbol &Sym = SD.getSymbol();
if (!Sym.isInSection())
return false;
return true;
if (!Asm)
return false;
- const MCSymbolData &SD = Asm->getSymbolData(Sym);
- return !Asm->getWriter().isWeak(SD);
+ return !Asm->getWriter().isWeak(Sym);
}
bool MCExpr::EvaluateAsRelocatableImpl(MCValue &Res, const MCAssembler *Asm,
return &SecA == &SecB;
}
-bool MCObjectWriter::isWeak(const MCSymbolData &SD) const { return false; }
+bool MCObjectWriter::isWeak(const MCSymbol &) const { return false; }
const MCFragment &FB, bool InSet,
bool IsPCRel) const override;
- bool isWeak(const MCSymbolData &SD) const override;
+ bool isWeak(const MCSymbol &Sym) const override;
void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFragment *Fragment, const MCFixup &Fixup,
InSet, IsPCRel);
}
-bool WinCOFFObjectWriter::isWeak(const MCSymbolData &SD) const {
+bool WinCOFFObjectWriter::isWeak(const MCSymbol &Sym) const {
+ const MCSymbolData &SD = Sym.getData();
if (!SD.isExternal())
return false;
- const MCSymbol &Sym = SD.getSymbol();
if (!Sym.isInSection())
return false;