summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-04-19 17:02:57 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-04-19 17:02:57 +0000
commit1834682b97f498093684674f8f0d95113ef3cb66 (patch)
tree7f13ae57ff184fa52b3d8edc807ec9f59956d121 /llvm/lib/Object/MachOObjectFile.cpp
parentaa94393ec538f2d65eb9a419a61937bdc954d01d (diff)
downloadbcm5719-llvm-1834682b97f498093684674f8f0d95113ef3cb66.tar.gz
bcm5719-llvm-1834682b97f498093684674f8f0d95113ef3cb66.zip
[llvm-objdump] Print "..." instead of random data for virtual sections
When disassembling with -D, skip virtual sections by printing "..." for each symbol. This patch also implements `MachOObjectFile::isSectionVirtual`. Test case comes from: ``` .zerofill __DATA,__common,_data64unsigned,472,3 ``` Differential Revision: https://reviews.llvm.org/D45824 llvm-svn: 330342
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index adc54b42eba..ae5efc52055 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -1968,8 +1968,10 @@ unsigned MachOObjectFile::getSectionID(SectionRef Sec) const {
}
bool MachOObjectFile::isSectionVirtual(DataRefImpl Sec) const {
- // FIXME: Unimplemented.
- return false;
+ uint32_t Flags = getSectionFlags(*this, Sec);
+ unsigned SectionType = Flags & MachO::SECTION_TYPE;
+ return SectionType == MachO::S_ZEROFILL ||
+ SectionType == MachO::S_GB_ZEROFILL;
}
bool MachOObjectFile::isSectionBitcode(DataRefImpl Sec) const {
OpenPOWER on IntegriCloud