Skip to content

COFF flags interpreted differently from ELF/MachO flags #411

@nikic

Description

@nikic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions