Skip to content
  • Ben Gamari's avatar
    3ece9856
    nativeGen: Explicitly set flags of text sections on Windows · 3ece9856
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    The binutils documentation (for COFF) claims,
    
    > If no flags are specified, the default flags depend upon the section
    > name. If the section name is not recognized, the default will be for the
    > section to be loaded and writable.
    
    We previously assumed that this would do the right thing for split
    sections (e.g. a section named `.text$foo` would be correctly inferred
    to be a text section). However, we have observed that this is not the
    case (at least under the clang toolchain used on Windows): when
    split-sections is enabled, text sections are treated by the assembler as
    data (matching the "default" behavior specified by the documentation).
    
    Avoid this by setting section flags explicitly. This should fix split
    sections on Windows.
    
    Fixes #22834.
    3ece9856
    nativeGen: Explicitly set flags of text sections on Windows
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    The binutils documentation (for COFF) claims,
    
    > If no flags are specified, the default flags depend upon the section
    > name. If the section name is not recognized, the default will be for the
    > section to be loaded and writable.
    
    We previously assumed that this would do the right thing for split
    sections (e.g. a section named `.text$foo` would be correctly inferred
    to be a text section). However, we have observed that this is not the
    case (at least under the clang toolchain used on Windows): when
    split-sections is enabled, text sections are treated by the assembler as
    data (matching the "default" behavior specified by the documentation).
    
    Avoid this by setting section flags explicitly. This should fix split
    sections on Windows.
    
    Fixes #22834.
Loading