From 1834682b97f498093684674f8f0d95113ef3cb66 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Thu, 19 Apr 2018 17:02:57 +0000 Subject: [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 --- llvm/lib/Object/MachOObjectFile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') 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 { -- cgit v1.2.3