-error_code ObjectFile::printSymbolName(raw_ostream &OS,
- DataRefImpl Symb) const {
- StringRef Name;
- if (error_code EC = getSymbolName(Symb, Name))
- return EC;
- OS << Name;
- return object_error::success;
+bool SectionRef::containsSymbol(SymbolRef S) const {
+ section_iterator SymSec = getObject()->section_end();
+ if (S.getSection(SymSec))
+ return false;
+ return *this == *SymSec;
+}
+
+uint64_t ObjectFile::getSymbolValue(DataRefImpl Ref) const {
+ uint32_t Flags = getSymbolFlags(Ref);
+ if (Flags & SymbolRef::SF_Undefined)
+ return 0;
+ if (Flags & SymbolRef::SF_Common)
+ return getCommonSymbolSize(Ref);
+ return getSymbolValueImpl(Ref);