diff --git a/cranelift/object/src/backend.rs b/cranelift/object/src/backend.rs index 5d221f7b41f6..c25369d90283 100644 --- a/cranelift/object/src/backend.rs +++ b/cranelift/object/src/backend.rs @@ -518,6 +518,13 @@ impl Module for ObjectModule { match self.object.section_flags_mut(section) { SectionFlags::MachO { flags } => { + // There are no default flags for the `SectionKind`s that + // we've specified above, so it's fine to override. + // + // (If we don't want to override, we'll have to be careful + // with how we set these, to ensure we set the section + // type properly). + assert_eq!(*flags, 0); *flags = *macho_flags; } _ => {