| Index: snapshot/mac/mach_o_image_segment_reader.cc
|
| diff --git a/snapshot/mac/mach_o_image_segment_reader.cc b/snapshot/mac/mach_o_image_segment_reader.cc
|
| index 8a077ddec036410e5ec373eb024c416712281d54..5c74d80dd1815ac10a9a6202e003abd1679ec727 100644
|
| --- a/snapshot/mac/mach_o_image_segment_reader.cc
|
| +++ b/snapshot/mac/mach_o_image_segment_reader.cc
|
| @@ -121,8 +121,8 @@ bool MachOImageSegmentReader::Initialize(ProcessReader* process_reader,
|
|
|
| if (section_segment_name != segment_name) {
|
| // cl_kernels modules (for OpenCL) aren’t ld output, and they’re formatted
|
| - // incorrectly on Mac OS X 10.10. They have a single __TEXT segment, but
|
| - // one of the sections within it claims to belong to the __LD segment.
|
| + // incorrectly on OS X 10.10 and 10.11. They have a single __TEXT segment,
|
| + // but one of the sections within it claims to belong to the __LD segment.
|
| // This mismatch shouldn’t happen. This errant section also has the
|
| // S_ATTR_DEBUG flag set, which shouldn’t happen unless all of the other
|
| // sections in the segment also have this bit set (they don’t). These odd
|
| @@ -132,13 +132,19 @@ bool MachOImageSegmentReader::Initialize(ProcessReader* process_reader,
|
| // sometimes more will be, tolerate this quirk.
|
| //
|
| // https://openradar.appspot.com/20239912
|
| - if (!(file_type == MH_BUNDLE &&
|
| - module_name == "cl_kernels" &&
|
| - MacOSXMinorVersion() == 10 &&
|
| + bool ok = false;
|
| + if (file_type == MH_BUNDLE && module_name == "cl_kernels") {
|
| + int mac_os_x_minor_version = MacOSXMinorVersion();
|
| + if ((mac_os_x_minor_version == 10 || mac_os_x_minor_version == 11) &&
|
| segment_name == SEG_TEXT &&
|
| section_segment_name == "__LD" &&
|
| section_name == "__compact_unwind" &&
|
| - (section.flags & S_ATTR_DEBUG))) {
|
| + (section.flags & S_ATTR_DEBUG)) {
|
| + ok = true;
|
| + }
|
| + }
|
| +
|
| + if (!ok) {
|
| LOG(WARNING) << "section.segname incorrect in segment " << segment_name
|
| << section_info;
|
| return false;
|
|
|