diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-16 10:53:11 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-16 10:53:11 +0000 |
commit | 209095cd9f69a225dd7afb3ced62609a17a9cc56 (patch) | |
tree | 11af366fe1853cb13365d5d85e92e687e86c2d8d /llvm/tools/llvm-objdump | |
parent | 5ff71205eef3831a98818211eb0a022b0030abee (diff) | |
download | bcm5719-llvm-209095cd9f69a225dd7afb3ced62609a17a9cc56.tar.gz bcm5719-llvm-209095cd9f69a225dd7afb3ced62609a17a9cc56.zip |
llvm-objdump: Don't print contents of BSS sections: it makes no sense and crashes llvm-objdump on relocated objects with large bss
llvm-svn: 179589
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 5a0519ddc11..6f4b101c308 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -468,11 +468,19 @@ static void PrintSectionContents(const ObjectFile *o) { StringRef Name; StringRef Contents; uint64_t BaseAddr; + bool BSS; if (error(si->getName(Name))) continue; if (error(si->getContents(Contents))) continue; if (error(si->getAddress(BaseAddr))) continue; + if (error(si->isBSS(BSS))) continue; outs() << "Contents of section " << Name << ":\n"; + if (BSS) { + outs() << format("<skipping contents of bss section at [%04" PRIx64 + ", %04" PRIx64 ")>\n", BaseAddr, + BaseAddr + Contents.size()); + continue; + } // Dump out the content as hex and printable ascii characters. for (std::size_t addr = 0, end = Contents.size(); addr < end; addr += 16) { |