summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorColin LeMahieu <colinl@codeaurora.org>2015-01-23 20:06:24 +0000
committerColin LeMahieu <colinl@codeaurora.org>2015-01-23 20:06:24 +0000
commit88fa664c1bc7aec4e717d5bdbfd2ad334d36423b (patch)
tree1b2c5d36924eeade0c6fe611b83ef2bbb14ec2da /tools
parentae597a058ae4d12cae9dc61500855ea885aa7930 (diff)
[Objdump] Output information about common symbols in a way closer to GNU objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index cd94a3a49c6..1204a973d45 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/tools/llvm-objdump/llvm-objdump.cpp
@@ -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 {