summaryrefslogtreecommitdiff
path: root/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-04-16 10:53:11 +0000
committerAlexey Samsonov <samsonov@google.com>2013-04-16 10:53:11 +0000
commit0eaa6f675cafb2bb1b6a6210797c1d7b3da3ff9f (patch)
tree359ad59de16e1909e311921ea4b95c9d9ab3bdac /tools/llvm-objdump/llvm-objdump.cpp
parent6334e1351f8f7bb58b3399d7c001eed0a32e1c64 (diff)
downloadllvm-0eaa6f675cafb2bb1b6a6210797c1d7b3da3ff9f.tar.gz
llvm-0eaa6f675cafb2bb1b6a6210797c1d7b3da3ff9f.tar.bz2
llvm-0eaa6f675cafb2bb1b6a6210797c1d7b3da3ff9f.tar.xz
llvm-objdump: Don't print contents of BSS sections: it makes no sense and crashes llvm-objdump on relocated objects with large bss
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index 5a0519ddc1..6f4b101c30 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/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) {