/// \param Alignment - The alignment of the symbol.
/// \param Target - Is the symbol a target-specific common-like symbol.
/// \return True if symbol was already declared as a different type
- bool declareCommon(uint64_t Size, unsigned Alignment, bool Target = false) {
+ bool declareCommon(uint64_t Size, Align Alignment, bool Target = false) {
assert(isCommon() || getOffset() == 0);
if(isCommon()) {
- if (CommonSize != Size || getCommonAlignment() != Align(Alignment) ||
+ if (CommonSize != Size || getCommonAlignment() != Alignment ||
isTargetCommon() != Target)
return true;
} else
- setCommon(Size, Align(Alignment), Target);
+ setCommon(Size, Alignment, Target);
return false;
}
switchSection(P.first, P.second);
} else {
- if (Symbol->declareCommon(Size, ByteAlignment.value()))
+ if (Symbol->declareCommon(Size, ByteAlignment))
report_fatal_error(Twine("Symbol: ") + Symbol->getName() +
" redeclared as different type");
}
SymbolELF->setExternal(true);
}
- if (SymbolELF->declareCommon(Size, Alignment.value(), true)) {
+ if (SymbolELF->declareCommon(Size, Alignment, true)) {
report_fatal_error("Symbol: " + Symbol->getName() +
" redeclared as different type");
}
switchSection(P.first, P.second);
} else {
- if (ELFSymbol->declareCommon(Size, ByteAlignment))
+ if (ELFSymbol->declareCommon(Size, Align(ByteAlignment)))
report_fatal_error("Symbol: " + Symbol->getName() +
" redeclared as different type");
if ((AccessSize) && (Size <= GPSize)) {