objdump: Don't print a (always 0) size for MachO symbols.

Only common symbol on MachO and COFF have a size.

For COFF we already had a custom format.

For MachO, there is no native objdump and we were printing it as ELF. Now
we only print the sizes for symbols that actually have them.

llvm-svn: 240422
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index dd484f2..77e95f6 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1085,7 +1085,6 @@
       continue;
     if (error(Symbol.getType(Type)))
       continue;
-    uint64_t Size = Symbol.getSize();
     if (error(Symbol.getSection(Section)))
       continue;
     StringRef Name;
@@ -1101,15 +1100,11 @@
     bool Common = Flags & SymbolRef::SF_Common;
     bool Hidden = Flags & SymbolRef::SF_Hidden;
 
-    if (Common) {
-      uint32_t Alignment = Symbol.getAlignment();
-      Address = Size;
-      Size = Alignment;
-    }
+    if (Common)
+      Address = Symbol.getSize();
+
     if (Address == UnknownAddressOrSize)
       Address = 0;
-    if (Size == UnknownAddressOrSize)
-      Size = 0;
     char GlobLoc = ' ';
     if (Type != SymbolRef::ST_Unknown)
       GlobLoc = Global ? 'g' : 'l';
@@ -1151,8 +1146,13 @@
         SectionName = "";
       outs() << SectionName;
     }
-    outs() << '\t'
-           << format("%08" PRIx64 " ", Size);
+
+    outs() << '\t';
+    if (Common)
+      outs() << format("%08" PRIx64 " ", Symbol.getAlignment());
+    else if (isa<ELFObjectFileBase>(o))
+      outs() << format("%08" PRIx64 " ", Symbol.getSize());
+
     if (Hidden) {
       outs() << ".hidden ";
     }