if (std::error_code EC = Sym.getAddress(Address))
return EC;
- if (Address == UnknownAddressOrSize) {
- Result = UnknownAddressOrSize;
- return object_error::success;
+ if (Address == UnknownAddress) {
+ Result = UnknownAddress;
+ return std::error_code();
}
const ObjectFile *Obj = Sym.getObject();
return EC;
if (SecI == Obj->section_end()) {
- Result = UnknownAddressOrSize;
- return object_error::success;
+ Result = UnknownAddress;
+ return std::error_code();
}
uint64_t SectionAddress = SecI->getAddress();
Result = Address - SectionAddress;
- return object_error::success;
+ return std::error_code();
}
std::pair<unsigned, unsigned>
uint32_t Flags = I->getFlags();
if (Flags & SymbolRef::SF_Common) {
// Add the common symbols to a list. We'll allocate them all below.
- uint64_t Size = 0;
- Check(I->getSize(Size));
+ uint64_t Size = I->getCommonSize();
CommonSize += Size;
}
}
}
uint32_t Align = Sym.getAlignment();
- uint64_t Size = 0;
- Check(Sym.getSize(Size));
+ uint64_t Size = Sym.getCommonSize();
CommonSize += Align + Size;
SymbolsToAllocate.push_back(Sym);
// Assign the address of each symbol
for (auto &Sym : SymbolsToAllocate) {
uint32_t Align = Sym.getAlignment();
- uint64_t Size;
StringRef Name;
- Check(Sym.getSize(Size));
+ uint64_t Size = Sym.getCommonSize();
Check(Sym.getName(Name));
if (Align) {
// This symbol has an alignment requirement.