Common symbols don't have a value.
[oota-llvm.git] / tools / dsymutil / DebugMap.cpp
index e5cc87b3f3181edc09cfa21db71f62bec364bb5b..46b269dc267238edf0ce86177671c5d90202621b 100644 (file)
@@ -216,7 +216,11 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::denormalize(IO &IO) {
     // during the test, we can't hardcode the symbols addresses, so
     // look them up here and rewrite them.
     for (const auto &Sym : ErrOrObjectFile->symbols()) {
-      uint64_t Address = Sym.getValue();
+      uint64_t Address;
+      if (Sym.getFlags() & SymbolRef::SF_Common)
+        Address = Sym.getCommonSize();
+      else
+        Address = Sym.getValue();
       ErrorOr<StringRef> Name = Sym.getName();
       if (!Name)
         continue;