diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-09-26 22:32:16 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-09-26 22:32:16 +0000 |
commit | dac39857d6545e32f20f0735a04b934f36b6c1d9 (patch) | |
tree | a969577804c80a12810628209ad39403b5edd65b /llvm/lib/DebugInfo | |
parent | b774a0e75071f4b32e741297b4e017615b01a8a9 (diff) | |
download | bcm5719-llvm-dac39857d6545e32f20f0735a04b934f36b6c1d9.tar.gz bcm5719-llvm-dac39857d6545e32f20f0735a04b934f36b6c1d9.zip |
Object: BSS/virtual sections don't have contents
Users of getSectionContents shouldn't try to pass in BSS or virtual
sections. In all instances, this is a bug in the code calling this
routine.
N.B. Some COFF implementations (like CL) will mark their BSS sections as
taking space on disk. This would confuse COFFObjectFile into thinking
the section is larger than the file.
llvm-svn: 218549
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index 1be0691a1d9..62e3b9ccf64 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -565,6 +565,15 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj) for (const SectionRef &Section : Obj.sections()) { StringRef name; Section.getName(name); + // Skip BSS and Virtual sections, they aren't interesting. + bool IsBSS; + Section.isBSS(IsBSS); + if (IsBSS) + continue; + bool IsVirtual; + Section.isVirtual(IsVirtual); + if (IsVirtual) + continue; StringRef data; Section.getContents(data); |