From 01c8f7cf46f186cb89f1fded8b642a8ec6c532de Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 30 Sep 2015 08:20:42 -0400 Subject: [mac] Teach dump_syms to handle additional zerofill sections This patch allows dump_syms to handle S_THREAD_LOCAL_ZEROFILL and S_GB_ZEROFILL section in the same way as the more common S_ZEROFILL section. Previously, dump_syms would fail to dump a binary containing a __DATA,__thread_bss section, because it tried to look up its data (and failed). R=mark@chromium.org Review URL: https://codereview.chromium.org/1369233003 . Patch from Pavel Labath . --- src/common/mac/macho_reader.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common/mac/macho_reader.cc') diff --git a/src/common/mac/macho_reader.cc b/src/common/mac/macho_reader.cc index 9fcb58e3..6d7207ce 100644 --- a/src/common/mac/macho_reader.cc +++ b/src/common/mac/macho_reader.cc @@ -481,7 +481,9 @@ bool Reader::WalkSegmentSections(const Segment &segment, reporter_->SectionsMissing(segment.name); return false; } - if ((section.flags & SECTION_TYPE) == S_ZEROFILL) { + const uint32_t section_type = section.flags & SECTION_TYPE; + if (section_type == S_ZEROFILL || section_type == S_THREAD_LOCAL_ZEROFILL || + section_type == S_GB_ZEROFILL) { // Zero-fill sections have a size, but no contents. section.contents.start = section.contents.end = NULL; } else if (segment.contents.start == NULL && -- cgit v1.2.1