diff --git a/runtime/platform/mach_o.h b/runtime/platform/mach_o.h index bae6943287c..1c5e5f7030a 100644 --- a/runtime/platform/mach_o.h +++ b/runtime/platform/mach_o.h @@ -103,6 +103,8 @@ static constexpr uint32_t MH_DYLDLINK = 0x4; // The object file does not re-export any of its input dynamic // libraries. static constexpr uint32_t MH_NO_REEXPORTED_DYLIBS = 0x100000; +// The object file uses two-level namespace bindings. +static constexpr uint32_t MH_TWOLEVEL = 0x80; struct load_command { // The tag that specifies the load command for the following diff --git a/runtime/vm/mach_o.cc b/runtime/vm/mach_o.cc index cd8340e6f44..b16b84a3257 100644 --- a/runtime/vm/mach_o.cc +++ b/runtime/vm/mach_o.cc @@ -1932,7 +1932,7 @@ class MachOHeader : public MachOContents { uint32_t flags() const { if (type_ == SnapshotType::Snapshot) { return mach_o::MH_NOUNDEFS | mach_o::MH_DYLDLINK | - mach_o::MH_NO_REEXPORTED_DYLIBS; + mach_o::MH_NO_REEXPORTED_DYLIBS | mach_o::MH_TWOLEVEL; } ASSERT(type_ == SnapshotType::DebugInfo || type_ == SnapshotType::Object); return 0;