When ELF or MachO flags are explicitly specified, they override the default flags implied by the SectionKind, see
|
let sh_flags = if let SectionFlags::Elf { sh_flags } = section.flags { |
and
|
let flags = if let SectionFlags::MachO { flags } = section.flags { |
.
However, for COFF the SectionKind flags are applied unconditionally in
|
characteristics |= match section.kind { |
. The specified characteristics are only added, they don't replace the defaults. It makes sense to me that the other flags (e.g. relating to alignment) are always added, but I'd have expected that the flags implied by SectionKind are omitted in this case, for consistency with ELF/MachO.
When ELF or MachO flags are explicitly specified, they override the default flags implied by the SectionKind, see
object/src/write/elf/object.rs
Line 689 in e45a3d1
object/src/write/macho.rs
Line 393 in e45a3d1
However, for COFF the SectionKind flags are applied unconditionally in
object/src/write/coff.rs
Line 310 in e45a3d1