[Objdump] Output information about common symbols in a way closer to GNU objdump.

llvm-svn: 226932
This commit is contained in:
Colin LeMahieu
2015-01-23 20:06:24 +00:00
parent c3c8b27616
commit bc2f47a76e
3 changed files with 13 additions and 0 deletions

View File

@@ -642,7 +642,15 @@ void llvm::PrintSymbolTable(const ObjectFile *o) {
bool Global = Flags & SymbolRef::SF_Global;
bool Weak = Flags & SymbolRef::SF_Weak;
bool Absolute = Flags & SymbolRef::SF_Absolute;
bool Common = Flags & SymbolRef::SF_Common;
if (Common) {
uint32_t Alignment;
if (error(Symbol.getAlignment(Alignment)))
Alignment = 0;
Address = Size;
Size = Alignment;
}
if (Address == UnknownAddressOrSize)
Address = 0;
if (Size == UnknownAddressOrSize)
@@ -672,6 +680,8 @@ void llvm::PrintSymbolTable(const ObjectFile *o) {
<< ' ';
if (Absolute) {
outs() << "*ABS*";
} else if (Common) {
outs() << "*COM*";
} else if (Section == o->section_end()) {
outs() << "*UND*";
} else {